各位大侠好,我在ViewFlipper中加了LinearLayout1、LinearLayout2、LinearLayout3, 如何才能实现按顺序与时间循环播放?  
如ViewFlipper包括LinearLayout1、LinearLayout2、LinearLayout3
第一个显示LinearLayout2(10秒), 下一个显示LinearLayout3(20秒), 然后又回到LinearLayout2, 以此循环.  备注: 本次不播放LinearLayout1, 但不可删除, 因为下次会用到(据输入参数判断)多谢.

解决方案 »

  1.   

    补充:
    以怎样才能单独设定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();
      

  2.   

    没用过,现在都Viewpager了。能否自己写循环线程控制?
      

  3.   

    viewflipper过时了,确实viewpager更灵活,直接加个timer好了,这个更好控制每个页面
      

  4.   

    setInAnimation(AnimationUtils.loadAnimation(this.context, R.anim.custom_in_anim));
    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这个标签就行了