欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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)文章

  • Android實(shí)現(xiàn)文件或文件夾壓縮成.zip格式壓縮包

    Android實(shí)現(xiàn)文件或文件夾壓縮成.zip格式壓縮包

    這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)文件或文件夾壓縮成.zip格式壓縮包,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2018-07-07
  • Android彈幕框架 黑暗火焰使基本使用方法

    Android彈幕框架 黑暗火焰使基本使用方法

    這篇文章主要介紹了Android彈幕框架黑暗火焰使基本使用方法,需要的朋友可以參考下。今天我將分享由BiliBili開源的Android彈幕框架(DanmakuFlameMaster)的學(xué)習(xí)經(jīng)驗(yàn),感興趣的朋友一起看看吧
    2016-10-10
  • Android studio保存logcat日志到本地的操作

    Android studio保存logcat日志到本地的操作

    這篇文章主要介紹了Android studio保存logcat日志到本地的操作,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧
    2020-04-04
  • Android修行手冊(cè)之ConstraintLayout布局使用詳解

    Android修行手冊(cè)之ConstraintLayout布局使用詳解

    這篇文章主要為大家介紹了Android修行手冊(cè)之ConstraintLayout使用示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-09-09
  • Android識(shí)別預(yù)裝的第三方App方法實(shí)例

    Android識(shí)別預(yù)裝的第三方App方法實(shí)例

    這篇文章主要給大家介紹了關(guān)于Android如何識(shí)別預(yù)裝的第三方App的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),需要的朋友可以參考借鑒,下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-01-01
  • Android LeakCanary的使用方法介紹

    Android LeakCanary的使用方法介紹

    在Android的性能優(yōu)化中,內(nèi)存優(yōu)化是必不可少的點(diǎn),而內(nèi)存優(yōu)化最重要的一點(diǎn)就是解決內(nèi)存泄漏的問題,在Android的內(nèi)存泄漏分析工具也不少,比如PC端的有:AndroidStudio自帶的Android Profiler、MAT等工具;手機(jī)端也有,就是我們今天要介紹的LeakCanary
    2022-09-09
  • Android 屬性動(dòng)畫原理與DataBinding

    Android 屬性動(dòng)畫原理與DataBinding

    這篇文章主要介紹了Android 屬性動(dòng)畫原理與DataBinding的相關(guān)資料,需要的朋友可以參考下
    2017-04-04
  • Android離線緩存的實(shí)例代碼

    Android離線緩存的實(shí)例代碼

    android很多時(shí)候需要考慮緩存的問題,本篇文章主要介紹了Android離線緩存的實(shí)例代碼,具有一定的參考價(jià)值,有興趣的可以了解一下。
    2017-01-01
  • Android WebView的使用方法及與JS 相互調(diào)用

    Android WebView的使用方法及與JS 相互調(diào)用

    這篇文章主要介紹了Android WebView的使用方法及與JS 相互調(diào)用的相關(guān)資料,WebView 是 Android 中一個(gè)非常實(shí)用的組&#8203;件, WebView 可以使得網(wǎng)頁輕松的內(nèi)嵌到app里,還可以直接跟js相互調(diào)用,需要的朋友可以參考下
    2017-07-07
  • Android圖表庫HelloCharts的實(shí)例詳解

    Android圖表庫HelloCharts的實(shí)例詳解

    這篇文章主要介紹了Android中的圖標(biāo)庫HelloCharts的一些簡(jiǎn)單使用實(shí)例,文中的示例代碼講解詳細(xì),對(duì)我們學(xué)習(xí)有一定的參考價(jià)值,需要的可以參考一下
    2022-01-01

最新評(píng)論