package com.animi.test; import com.animi.test.R; import android.app.Activity; import android.graphics.drawable.AnimationDrawable; import android.os.Bundle; import android.view.ViewTreeObserver.OnPreDrawListener; import android.widget.LinearLayout; public class animActivity extends Activity { private LinearLayout linearLayout = null; private AnimationDrawable anim = null; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); linearLayout = (LinearLayout) findViewById(R.id.linearLayout); linearLayout.getViewTreeObserver().addOnPreDrawListener(onpdl); } OnPreDrawListener onpdl = new OnPreDrawListener() { @Override public boolean onPreDraw() { Object ob = linearLayout.getBackground(); anim = (AnimationDrawable) ob; anim.start(); return true; } }; }
by: ETmanwenhan 发表于:2013-04-19 19:17:54 顶(1) | 踩(0) 回复
好学的娃,求学真的没门,等得好苦啊!!!好心人一生幸福,本人邮箱:1528693256@qq.com,谢谢有代码的大神发到我的邮箱!
初级程序员
by: ETmanwenhan 发表于:2013-04-19 19:15:23 顶(3) | 踩(0) 回复
在要等等到什么时候才可以下载啊,没积分伤不起啊!
回复评论