android实现抖动效果
16lz
2021-12-04
实现抖动是采用的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(安卓)xml资源文件中@、@android:type、@*、?、@+含义和区
- Android(安卓)xml资源文件中@、@android:type、@*、?、@+含义和区
- Android学习笔记(二八):字体
- 使用myelipse配置android开发环境
- Android(安卓)资源文件中@、@android:type、@*、?、@+含义和区别
- Android(安卓)开发框架
- Android(安卓)之不要滥用 SharedPreferences(上)
- Hello, Android(安卓)深入(一)
- Android修改自己程序字体