您的位置:首页 > 移动开发 > Android开发

Android图片的晃动效果

2015-12-13 22:40 375 查看
拉手反编译文件里面看到的

先上测试效果图



shake.xml

<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:fromXDelta="0.0"
android:interpolator="@anim/cycle_7"
android:toXDelta="10.0" />


cycle_7.xml
<?xml version="1.0" encoding="utf-8"?>
<cycleInterpolator android:cycles="7.0"
xmlns:android="http://schemas.android.com/apk/res/android" />


public void btn(View v)
{
Animation animation = AnimationUtils.loadAnimation(this,
R.anim.shake);
animation.setFillAfter(true);
imageView1.startAnimation(animation);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: