Kom*_*omi 12
在动画xml中,你可以像这样使用scale:
<scale
android:pivotX="50%"
android:pivotY="50%"
android:fromXScale=".1"
android:fromYScale=".1"
android:toXScale="1.0"
android:toYScale="1.0"
android:duration="2000" />
Run Code Online (Sandbox Code Playgroud)
Des*_*tro 10
ScaleAnimation scal=new ScaleAnimation(0, 1f, 0, 1f, Animation.RELATIVE_TO_SELF, (float)0.5,Animation.RELATIVE_TO_SELF, (float)0.5);
scal.setDuration(500);
scal.setFillAfter(true);
((ImageView)findViewById(R.id.logo)).setAnimation(scal);
Run Code Online (Sandbox Code Playgroud)
我有一个想法,希望它有所帮助.
AnimationSet animSet = new AnimationSet(false);
RotateAnimation rotate = new RotateAnimation(0, 180);
ScaleAnimation zoom = new ScaleAnimation(0, 0, 1, 1);
animSet.addAnimation(rotate);
animSet.addAnimation(zoom);
animSet.start();
Run Code Online (Sandbox Code Playgroud)
您应该根据需要更改参数.
| 归档时间: |
|
| 查看次数: |
17414 次 |
| 最近记录: |