我在自定义视图中绘制一个圆圈,点击时圆圈变大,我应该如何使用动画。
答案 0 :(得分:0)
使用ScaleAnimation
public void scaleView(View v,float xxScaleValue,float yScaleValue) {
Animation anim = new ScaleAnimation(
1f, xScaleValue, // for the X axis scaling
1f, yScaleValue) // for the Y axis scaling
anim.setFillAfter(true); // Needed to keep the result of the animation
v.startAnimation(anim);
}
在你的活动电话中
scaleView(yourview,2f,2f); //your own scaling values