android实现抖动效果
16lz
2021-01-23
实现抖动是采用的Animation动画
shake.xml文件
cycle_7.xml文件
使用这个效果,只需下面两行代码:
shake.xml文件
<translate xmlns:android="http://schemas.android.com/apk/res/android" android:fromXDelta="0" android:toXDelta="10" android:duration="1000" android:interpolator="@anim/cycle_7" />
cycle_7.xml文件
<cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android" android:cycles="7" />
使用这个效果,只需下面两行代码:
Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake); findViewById(R.id.xxxx).startAnimation(shake);
更多相关文章
- Android Studio开发实战练习--跑马灯效果
- Android系统中TextView实现滚动效果
- android studio查看模拟器文件夹
- 跟大家分享下Android布局文件layout.xml的一些属性值。