安卓旋转动画质量优化

5

我有一个旋转动画,将其应用于一个视图,以下是代码:

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

在播放动画时,我的视图边距变得像素化:
有没有办法解决这个问题?
1个回答

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);

这个能帮助解决这个问题吗?http://stackoverflow.com/questions/15837600/how-to-avoid-pixelation-when-resizing-shrinking-images-on-android - dazhi

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接