1 <?xml version="1.0" encoding="utf-8"?>
2 <animation-list xmlns:android="http://schemas.android.com/apk/res/android"
3 android:oneshot="false" >
4
5 <item
6 android:drawable="@drawable/girl_1"
7 android:duration="200"/>
8
9 <item
10 android:drawable="@drawable/girl_2"
11 android:duration="200"/>
12
13 <item
14 android:drawable="@drawable/girl_3"
15 android:duration="200"/>
16
17 <item
18 android:drawable="@drawable/girl_4"
19 android:duration="200"/>
20
21 <item
22 android:drawable="@drawable/girl_5"
23 android:duration="200"/>
24
25 <item
26 android:drawable="@drawable/girl_6"
27 android:duration="200"/>
28
29 <item
30 android:drawable="@drawable/girl_7"
31 android:duration="500"/>
32
33 <item
34 android:drawable="@drawable/girl_8"
35 android:duration="200"/>
36
37 <item
38 android:drawable="@drawable/girl_9"
39 android:duration="200"/>
40
41 <item
42 android:drawable="@drawable/girl_10"
43 android:duration="200"/>
44
45 <item
46 android:drawable="@drawable/girl_11"
47 android:duration="200"/>
48
49 </animation-list>
layout文件
成都創(chuàng)新互聯(lián)是一家專注于網(wǎng)站設計、網(wǎng)站制作與策劃設計,陽西網(wǎng)站建設哪家好?成都創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設十載,網(wǎng)設計領域的專業(yè)建站公司;建站業(yè)務涵蓋:陽西等地區(qū)。陽西做網(wǎng)站價格咨詢:13518219792 1 <?xml version="1.0" encoding="utf-8"?>
2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:layout_width="fill_parent"
4 android:layout_height="fill_parent"
5 android:orientation="vertical" >
6
7 <ImageView
8 android:id="@+id/iv"
9 android:layout_width="wrap_content"
10 android:layout_height="wrap_content"
11 android:background="@drawable/anim" />
12
13 <Button
14 android:id="@+id/button1"
15 android:layout_width="wrap_content"
16 android:layout_height="wrap_content"
17 android:onClick="click"
18 android:text="播放動畫" />
19
20 </LinearLayout>
Activity代碼
1 package cn.itcast.frame;
2
3 import android.app.Activity;
4 import android.graphics.drawable.AnimationDrawable;
5 import android.os.Bundle;
6 import android.view.View;
7 import android.widget.ImageView;
8
9 public class DemoActivity extends Activity {
10 ImageView rocketImage;
11 AnimationDrawable animationDrawable;
12
13 @Override
14 public void onCreate(Bundle savedInstanceState) {
15 super.onCreate(savedInstanceState);
16 setContentView(R.layout.main);
17
18 rocketImage = (ImageView) findViewById(R.id.iv);
19 rocketImage.setBackgroundResource(R.drawable.anim);
20 animationDrawable = (AnimationDrawable) rocketImage.getBackground();
21 }
22
23 public void click(View view) {
24 animationDrawable.start();
25 }
26 }
標題名稱:Android動畫效果(幀動畫)-創(chuàng)新互聯(lián)
網(wǎng)頁路徑:http://muchs.cn/article8/dhghop.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供外貿(mào)網(wǎng)站建設、電子商務、靜態(tài)網(wǎng)站、關鍵詞優(yōu)化、企業(yè)建站、網(wǎng)站營銷
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容