<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/img1"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/img1"
android:layout_centerHorizontal="true"
android:layout_marginTop="156dp"
android:text="submit"
/>
ありがとう描画可能で
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ImageView i = (ImageView)findViewById(R.id.img1);
i.setBackgroundResource(R.drawable.gif);
AnimationDrawable pro = (AnimationDrawable)i.getBackground();
pro.start();
}
}
アニメーションファイル
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/selected" android:oneshot="false">
<item android:drawable="@drawable/frame0" android:duration="50" />
<item android:drawable="@drawable/frame1" android:duration="50" />
<item android:drawable="@drawable/frame2" android:duration="50" />
<item android:drawable="@drawable/frame3" android:duration="50" />
<item android:drawable="@drawable/frame4" android:duration="50" />
<item android:drawable="@drawable/frame5" android:duration="50" />
<item android:drawable="@drawable/frame6" android:duration="50" />
<item android:drawable="@drawable/frame7" android:duration="50" />
<item android:drawable="@drawable/frame8" android:duration="50" />
<item android:drawable="@drawable/frame8" android:duration="50" />
<item android:drawable="@drawable/frame9" android:duration="50" />
<item android:drawable="@drawable/frame10" android:duration="50" />
</animation-list>
希望を作成し、これはあなた
それはあなたを助けるん役立つかもしれませんか? http://mobile.tutsplus.com/tutorials/android/creating-live-wallpapers-on-android/ – RobinHood
壁紙を作成する方法については、この話があります。私はこれらのアニメーション化された背景が最初にどのように行われるかにもっと興味があります。プログラムで鳥を描く?または、画像を使用するかGIFを使用するか、特別な描画ツールを使用しますか? – Snake
クリップの長さはどのくらいですか?そしてそれはフルスクリーンであるか、アニメ化された部分だけですか? – pumpkee