我想创建一个应用程序,我需要在单击时自定义按钮,旋转并从其后面显示图像..请注意,我是初学者,所以不要使用非常技术性的语言..
提前致谢
[编辑]请告诉我应该如何设计xml ..直到现在我已经创建了一个自定义按钮..所以我应该在它后面还是前面制作一个图像视图..
[添加代码]
button1.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
// TODO Auto-generated method stub
RotateAnimation rotate = new RotateAnimation(0,90);
rotate.setFillAfter(true);
button1.startAnimation(rotate);
AlphaAnimation alpha = new AlphaAnimation(0,1);
alpha.setFillAfter(true);
image.startAnimation(alpha);
}});
image.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
// TODO Auto-generated method stub
AlphaAnimation alpha = new AlphaAnimation(1,0);
alpha.setFillAfter(true);
image.startAnimation(alpha);
RotateAnimation rotate = new RotateAnimation(90,0);
rotate.setFillAfter(true);
button1.startAnimation(rotate);
}});