Android 디 더 링 애니메이션 효과
1855 단어 android
1 <translate xmlns:android="http://schemas.android.com/apk/res/android"
2 android:fromXDelta="0"
3 android:toXDelta="10"
4 android:duration="300"
5 android:interpolator="@anim/cycle" /> 그리고 res / anim 에서 cycle. xml 를 정의 하여 떨 림 횟수 를 제어 합 니 다. 여기 서 사용 하 는 5 회:
1 <cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
2 android:cycles="5" /> 그리고 자바 코드 에서 이 애니메이션 을 사용 합 니 다:
1 Animation shake = AnimationUtils.loadAnimation(mContext, R.anim.shake);
2 yourview.startAnimation(shake);