2011-12-08 4 views
4

アンドロイド回転アニメーションは、ここのコードです:私はビューに適用しています回転アニメーションを持っている品質

RotateAnimation shake = new RotateAnimation(-3, 3, 10, 10); 
    shake.setRepeatCount(Animation.INFINITE); 
    shake.setRepeatMode(Animation.REVERSE); 
    shake.setDuration(SHAKE_ANIMATION_DURATION); 

しかし、アニメーションを再生しながら、私の見解のマージンは、ピクセル化取得:

image:

これを修正する方法はありますか?

答えて

5

イメージを読み込むときに、アンチエイリアスフラグを設定します。 XMLで
:オンザフライ

<bitmap xmlns:android="http://schemas.android.com/apk/res/android" 
    android:src="@drawable/tile" 
    android:tileMode="disabled" 
    android:antialias="true"/> 

ImageView iv = (ImageView) findViewById(R.id.image); 
((BitmapDrawable)iv.getDrawable()).setAntiAlias(true); 
+0

これも、この問題を解決する助けてもらえますか? http://stackoverflow.com/questions/15837600/how-to-avoid-pixelation-when-resizing-shrinking-images-on-android – dazhi

関連する問題