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

Android layoutAnimation詳解及應用

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

 Android layoutAnimation詳解及應用

前言:

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

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

在看咱們模仿的:

差不多,在微調一下就好了!

上點代碼,其實很簡單:

首先新建一個anim文件夾在里面新建兩個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> 

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

<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é)決定成敗??!

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

相關文章

最新評論

绩溪县| 北票市| 宝山区| 班玛县| 辽宁省| 潜江市| 革吉县| 连江县| 瑞金市| 盐边县| 手机| 宣武区| 怀宁县| 会理县| 兴隆县| 大宁县| 芜湖县| 泰安市| 章丘市| 衡山县| 浪卡子县| 青海省| 宜良县| 巨野县| 荆门市| 新建县| 桦南县| 梨树县| 黄大仙区| 泽库县| 闽侯县| 肥乡县| 广南县| 淮南市| 肃南| 保靖县| 青州市| 台北县| 中牟县| 吴堡县| 瓮安县|