在Android4.4上 使用TranslateAnimation動畫位移會有卡頓現象,如果在別的版本中將
android:hardwareAccelerated="false"
設置成這個屬性也會有卡頓問題,經過一系列的排查就是這個問題
https://code.google.com/p/android/issues/detail?id=63003
這兒有人提出來了,但是還是沒有得到解決!
但是在我師傅發給我的郵件中犀利的解決了!
動畫的替換:TranslateAnimation 替換 ViewPropertyAnimator,
http://developer.android.com/reference/android/view/ViewPropertyAnimator.html
使用方法:
animate().translationXBy(x).translationYBy(y).setDuration(400).setInterpolator(new DecelerateInterpolator()).start();
感謝師傅sjq!
分享是一種美德!