最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

ViewFlipper實(shí)現(xiàn)上下翻滾輪播效果

 更新時(shí)間:2019年08月22日 10:19:55   作者:猴菇同學(xué)  
這篇文章主要為大家詳細(xì)介紹了ViewFlipper實(shí)現(xiàn)上下翻滾輪播效果,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

一種可以設(shè)置滑動(dòng)動(dòng)畫的控件,只顯示一行布局,在布局文件中的ViewFlipper控件中順序?qū)懞妹恳恍械牟季?/p>

(1).MainActivity.java:

ViewFlipper mFlipper = ((ViewFlipper) this.findViewById(R.id.flipper));
mFlipper.startFlipping();
// 設(shè)置進(jìn)入動(dòng)畫
mFlipper.setInAnimation(AnimationUtils.loadAnimation(this, R.anim.push_up_in)); 
// 設(shè)置滾出動(dòng)畫
mFlipper.setOutAnimation(AnimationUtils.loadAnimation(this, R.anim.push_up_out)); 

(2).activity_main.xml:

<ViewFlipper
  android:id="@+id/flipper"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:layout_marginBottom="20dip"
  android:flipInterval="3000" > // 設(shè)置滑動(dòng)間隔時(shí)間(毫秒)

  <TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_horizontal"
    android:text="@string/animation_2_text_1"
    android:textSize="26sp" />

  <TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_horizontal"
    android:text="@string/animation_2_text_2"
    android:textSize="26sp" />

  <TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_horizontal"
    android:text="@string/animation_2_text_3"
    android:textSize="26sp" />
</ViewFlipper>

(3).push_up_in.xml:(動(dòng)畫資源文件)

<set xmlns:android="http://schemas.android.com/apk/res/android">
  <translate android:fromYDelta="100%p" android:toYDelta="0" android:duration="300"/>
  <alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="300" />
</set>

push_up_out.xml:

<set xmlns:android="http://schemas.android.com/apk/res/android">
  <translate android:fromYDelta="0" android:toYDelta="-100%p" android:duration="300"/>
  <alpha android:fromAlpha="1.0" android:toAlpha="0.0" android:duration="300" />
</set>

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論

平乐县| 郴州市| 房产| 马山县| 获嘉县| 柘荣县| 金山区| 阿巴嘎旗| 岳池县| 威远县| 丹棱县| 宝坻区| 土默特右旗| 乌鲁木齐县| 安溪县| 南京市| 滨海县| 泗阳县| 乌兰察布市| 康保县| 日照市| 白河县| 通榆县| 泾川县| 宁南县| 团风县| 沙坪坝区| 汉源县| 永顺县| 威远县| 肥西县| 襄汾县| 石狮市| 安丘市| 台中县| 安义县| 班戈县| 青河县| 温泉县| 遂平县| 凤凰县|