各位大侠好,我在ViewFlipper中加了LinearLayout1、LinearLayout2、LinearLayout3, 如何才能实现按顺序与时间循环播放?
如ViewFlipper包括LinearLayout1、LinearLayout2、LinearLayout3
第一个显示LinearLayout2(10秒), 下一个显示LinearLayout3(20秒), 然后又回到LinearLayout2, 以此循环. 备注: 本次不播放LinearLayout1, 但不可删除, 因为下次会用到(据输入参数判断)多谢.
如ViewFlipper包括LinearLayout1、LinearLayout2、LinearLayout3
第一个显示LinearLayout2(10秒), 下一个显示LinearLayout3(20秒), 然后又回到LinearLayout2, 以此循环. 备注: 本次不播放LinearLayout1, 但不可删除, 因为下次会用到(据输入参数判断)多谢.
解决方案 »
- google play发布收费app有什么好办法
- 加急求!下载rar包并解压,读取里面的图片在gallery上显示
- android文件下载遇到两个问题,请大侠来解决!!
- 关于android状态栏图标
- PopupWindow 加载 ListView时,ListView 的Item select事件问题
- android 调用wcf 请come
- 基于Android的手机智能监控系统
- scrollview中添加gridview,并更新UI
- 广州谷歌开发者社区DevFest2014
- 为什么APP连上WIFI就请求数据很慢!就算是3G网络都比WIFI快的多!
- 开发考虑不考虑用户到程序设置中清除数据,清除数据后sharedpreference中的配置就都没了
- 监听网络变化,1次变化收到4次广播
以怎样才能单独设定View 播放时间并循环播放?
this.mViewFlipper = (ViewFlipper) findViewById(R.id.details);
View layout003 = LayoutInflater.from(MainActivity.this).inflate(R.layout.layout_003, null);
View layout002 = LayoutInflater.from(MainActivity.this).inflate(R.layout.layout_002, null);
this.mViewFlipper.addView(layout003);
this.mViewFlipper.addView(layout002);
this.mViewFlipper.setAutoStart(true);
this.mViewFlipper.setFlipInterval(5000);
this.mViewFlipper.startFlipping();
setOutAnimation(AnimationUtils.loadAnimation(this.context, R.anim.custom_out_anim));custom_in_anim.xml:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="400"
android:fromXDelta="-100%p"
android:toXDelta="0" />
</set>duration是时间,具体图片怎么进入,怎么退出,你自己定义translate这个标签就行了