读书人

容易位移动画TranslateAnimation

发布时间: 2012-09-11 10:49:03 作者: rapoo

简单位移动画TranslateAnimation
动画中的View的点击判断
http://blog.csdn.net/seker_xinjian/article/details/7236945
Android 动画框架详解
http://www.ibm.com/developerworks/cn/opensource/os-cn-android-anmt1/index.html




每次点击往前100或往后100.




使用:
import android.app.Activity;import android.os.Bundle;import android.view.animation.Animation;import android.view.animation.AnimationUtils;import android.widget.ImageView;import android.widget.TextView;public class App extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Animation alpha = AnimationUtils.loadAnimation(this, R.anim.anim_alpha);        Animation translate = AnimationUtils.loadAnimation(this, R.anim.anim_translate);        Animation scale = AnimationUtils.loadAnimation(this, R.anim.anim_scale);                TextView tv=(TextView)findViewById(R.id.tv);        tv.startAnimation(alpha);        ImageView iv0=(ImageView)findViewById(R.id.iv0);        ImageView iv1=(ImageView)findViewById(R.id.iv1);        ImageView iv2=(ImageView)findViewById(R.id.iv2);        iv0.startAnimation(alpha);        iv1.startAnimation(translate);        iv2.startAnimation(scale);            }}
1 楼 进阶兄 2011-09-06 多谢,但凡觉得有用的,都支持一下

读书人网 >移动开发

热点推荐