最初,会有一个网点,点击一个按钮,网点必须转换成一个矩形框。
这是单击按钮时发生的一系列事件

help是appreciated.thanks
发布于 2014-03-14 18:57:56
下面是一个简单的方法
如果它是可绘制的,则将此可绘制设置为视图。
1. set onclicklistener to the view via 新建(view..setOnClickListener View.OnClickListener() {
@Override public void onClick(View v) { Animation anim = AnimationUtils.loadAnimation(YourActivity.this, R.anim.dot2square); //v.setAnimation(anim); v.startAnimation(anim); } });1. last step.
将这段代码添加到res/anim/文件夹中的文件(dot2square.xml)中。
<scale xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:fillAfter="true"
android:fromXScale="0.1"
android:fromYScale="0.1"
android:interpolator="@android:anim/linear_interpolator"
android:toXScale="1"
android:pivotX="50%"
android:pivotY="50%"
android:toYScale="1" >
</scale>摘要:在android提供的xml格式中定义动画。然后将动画设置为视图并启动
https://stackoverflow.com/questions/22401798
复制相似问题