Android layout Animation 상세 설명 및 응용

Android layout Animation 상세 설명 및 응용
선언:
최근 애플 리 케 이 션 을 하 다가 처음 그의 페이지 에 들 어 왔 을 때 그의 페이지 의 하위 컨트롤 이 모두 오른쪽 에서 날 아 왔 다 는 것 을 알 게 되 었 다.강 한 느낌 이 들 어서 하 나 를 따라 했다.보기에 확실히 그곳 에 틀 어 박 혀 있 는 것 보다 훨씬 편안 하 다!

그래도 예 뻐!어쨌든 나 는 거기에 틀 어 박 혀 있 는 것 보다 낫다 고 생각한다!그게!
우리 가 모방 한 것 을 보고 있다.

많 지 않 으 니 조금 만 더 조정 하면 된다!
위의 코드 는 사실 매우 간단 하 다.
우선 anim 폴 더 를 새로 만 들 고 xml 두 개 를 새로 만 듭 니 다.

<layoutAnimation xmlns:android="http://schemas.android.com/apk/res/android" 
    android:delay="90%" //        
    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> 
이 애니메이션 을 레이아웃 에 설치 하기 만 하면 이 효과 가 나타 납 니 다.토치카 입 니 다!

<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> 
이렇게 간단 한 몇 마디 로 사용자 체험 이 갑자기 많이 올 라 간 것 같 습 니 다!정말 세부 적 인 것 이 성 패 를 결정 하 는 구나!
 읽 어 주 셔 서 감사합니다. 여러분 에 게 도움 이 되 기 를 바 랍 니 다.본 사이트 에 대한 여러분 의 지지 에 감 사 드 립 니 다!

좋은 웹페이지 즐겨찾기