당신은 RelativeLayout의 또는 AbsoluteLayout을 사용할 수 있습니다에서 발견 역학을 적용했습니다, 거기에 (그게 부모의 덮개) 이미지를 넣고 활동의 현재 레이아웃을 탑재합니다. 이제 해당 이미지에 애니메이션을 설정하면 활동의 배경이 움직이는 것처럼 보입니다. 예를 들어
은이 활동의 현재 레이아웃입니다 가정 :
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/vg"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher" />
</LinearLayout>
지금이 레이아웃은 이전의 레이아웃과 같은 당신은 ID가 img1
가이다 그건 그 이미지에 애니메이션을 설정할 수 있습니다 (이, 배경으로 보인다 : 메인 레이아웃의 아 운드가) :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/vg"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/img1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_x="0dp"
android:layout_y="0dp"
android:src="@drawable/bright_sun" />
<LinearLayout
android:id="@+id/vg2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher" />
</LinearLayout>
</RelativeLayout>
고맙습니다. 답장을 많이 드려요 ... 이미지를 애니메이션으로 설정하는 방법을 간단히 설명해 주시겠습니까? 애니메이션 GIF로 설정하면 도움이되지 않습니까? :) –
@ brunolau 원하는 것을 잘 모르겠습니다. 드로어 블 애니메이션 (프레임 애니메이션)을 원하거나 '트위닝 된 애니메이션'을 실행 하시겠습니까? 트윈 애니메이션은 일련의 간단한 변환 (위치 , 크기, 회전 및 투명도)보기 객체의 내용에 – hasanghaforian
안녕하세요, 프레임 애니메이션을 사용하고 싶습니다 ... Drawable을 의미한다면 그 중 하나입니다. –