美文网首页
左右抖动动画

左右抖动动画

作者: 六便士少年 | 来源:发表于2015-04-20 14:55 被阅读89次

xml文件
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="50"
android:fromDegrees="-5"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="infinite"
android:repeatMode="reverse"
android:toDegrees="5" />
在代码中使用
Animation animation = AnimationUtils.loadAnimation(MainActivity.this, R.anim.anim_shack); ball.startAnimation(animation);

相关文章

网友评论

      本文标题:左右抖动动画

      本文链接:https://www.haomeiwen.com/subject/gytufttx.html