WEB开发网
开发学院手机开发Android 开发 Android Animation--->TweemAnimation运用 阅读

Android Animation--->TweemAnimation运用

 2012-07-01 12:16:12 来源:WEB开发网   
核心提示:.view.View.OnClickListener;import android.view.animation.Animation;import android.view.animation.AnimationUtils;import android.widget.Button;import android.widg
.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.ImageView;
public class Animation1Activity extends
Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(
Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final ImageView mImageView = (ImageView) findViewById(R.id.imageView1);
mImageView
.setImageResource(R.drawable.icon);
findViewById(R.id.button15)
.setOnClickListener(
new OnClickListener() {
@Override
public void onClick(
View v) {
// TODO Auto-generated method stub
final Animation animation2 = AnimationUtils
.loadAnimation(
Animation1Activity.this,
R.anim.setanimation1);
mImageView
.startAnimation(animation2);
}
});
findViewById(R.id.button2)
.setOnClickListener(
new OnClickListener() {
@Override
public void onClick(
View v) {
// TODO Auto-generated method stub
final Animation animation1 = AnimationUtils
.loadAnimation(
Animation1Activity.this,
R.anim.setanimation);
mImageView
.startAnimation(animation1);
}
});
findViewById(R.id.button3)
.setOnClickListener(
new OnClickListener() {
@Override
public void onClick(
View v) {
// TODO Auto-generated method stub
final Animation animation2 = AnimationUtils
.loadAnimation(
Animation1Activity.this,
R.anim.setanimation2);
mImageView
.startAnimation(animation2);
}
});
findViewById(R.id.button4)
.setOnClickListener(
new OnClickListener() {
@Override
public void onClick(
View v) {
new AnimationUtils();
// TODO Auto-generated method stub
final Animation animation3 = AnimationUtils
.loadAnimation(
Animation1Activity.this,
R.anim.alpha_animation);
mImageView
.startAnimation(animation3);
}
});
}
}
-----------------------

上一页  1 2 

Tags:Android Animation gt

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接