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

Android layoutAnimation詳解及應(yīng)用

 更新時(shí)間:2017年05月03日 10:52:54   作者:小_源  
這篇文章主要介紹了Android layoutAnimation詳解及應(yīng)用的相關(guān)資料,需要的朋友可以參考下

 Android layoutAnimation詳解及應(yīng)用

前言:

最近在玩一個(gè)APP的時(shí)候,發(fā)現(xiàn)剛進(jìn)入他的頁面,他頁面的子控件都是從右側(cè)飛過來的,感覺好牛的樣子,就順便模仿了一個(gè)??粗_實(shí)是比死板呆在那舒服多了!

還是感覺很好看!反正我覺得比死板呆在那好看!你們覺得那!

在看咱們模仿的:

差不多,在微調(diào)一下就好了!

上點(diǎn)代碼,其實(shí)很簡(jiǎn)單:

首先新建一個(gè)anim文件夾在里面新建兩個(gè)xml

<layoutAnimation xmlns:android="http://schemas.android.com/apk/res/android" 
    android:delay="90%" //空間的執(zhí)行間隔 
    android:animation="@anim/trans" /> 
<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator"> 
  <translate  
    android:fromXDelta="100%p" android:toXDelta="0" 
    android:duration="200" /> 
  <alpha 
    android:fromAlpha="0" android:toAlpha="1" 
    android:duration="200" 
    /> 
</set> 

只要把這個(gè)動(dòng)畫在布局里面設(shè)置一下就出現(xiàn)這個(gè)效果,碉堡了!

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
  android:layout_width="fill_parent" 
  android:layout_height="fill_parent" 
  android:background="#e6e6e6" 
  android:layoutAnimation="@anim/anim" 
  android:orientation="vertical" > 
 
  <LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:gravity="center|left" 
    android:background="#ffffff" 
    android:layout_margin="5dip" 
    android:orientation="horizontal" > 
 
    <ImageView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/ic_launcher" /> 
 
    <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="TextView" /> 
  </LinearLayout> 
<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:gravity="center|left" 
    android:background="#ffffff" 
    android:layout_margin="5dip" 
    android:orientation="horizontal" > 
 
    <ImageView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/ic_launcher" /> 
 
    <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="TextView" /> 
  </LinearLayout> 
  <LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:gravity="center|left" 
    android:background="#ffffff" 
    android:layout_margin="5dip" 
    android:orientation="horizontal" > 
 
    <ImageView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/ic_launcher" /> 
 
    <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="TextView" /> 
  </LinearLayout> 
  <LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:gravity="center|left" 
    android:background="#ffffff" 
    android:layout_margin="5dip" 
    android:orientation="horizontal" > 
 
    <ImageView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/ic_launcher" /> 
 
    <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="TextView" /> 
  </LinearLayout> 
  <LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:gravity="center|left" 
    android:background="#ffffff" 
    android:layout_margin="5dip" 
    android:orientation="horizontal" > 
 
    <ImageView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/ic_launcher" /> 
 
    <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="TextView" /> 
  </LinearLayout> 
  <LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:gravity="center|left" 
    android:background="#ffffff" 
    android:layout_margin="5dip" 
    android:orientation="horizontal" > 
 
    <ImageView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/ic_launcher" /> 
 
    <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="TextView" /> 
  </LinearLayout> 
  <LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:gravity="center|left" 
    android:background="#ffffff" 
    android:layout_margin="5dip" 
    android:orientation="horizontal" > 
 
    <ImageView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/ic_launcher" /> 
 
    <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="TextView" /> 
  </LinearLayout> 
</LinearLayout> 

就這么簡(jiǎn)單的幾句話,感覺用戶體驗(yàn)頓時(shí)上升了不少!真是細(xì)節(jié)決定成敗??!

 感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!

相關(guān)文章

最新評(píng)論

曲靖市| 东丽区| 四会市| 南召县| 天祝| 溆浦县| 家居| 白城市| 六安市| 安宁市| 神农架林区| 子洲县| 福泉市| 青神县| 惠安县| 集安市| 台中市| 亚东县| 天祝| 那坡县| 邛崃市| 华蓥市| 黄山市| 望江县| 长垣县| 安徽省| 宜兴市| 黄浦区| 承德市| 云安县| 慈利县| 临沭县| 昆山市| 资中县| 浮山县| 灵川县| 兰坪| 玛曲县| 阳山县| 五河县| 安陆市|