【问题标题】:android rotate animation qualityandroid旋转动画质量
【发布时间】:2011-12-08 14:04:33
【问题描述】:

我有一个旋转动画,我将它应用到一个视图中,代码如下:

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

但是在播放动画时,我的视图边距会像素化:

有没有办法解决这个问题?

【问题讨论】:

    标签: android animation view


    【解决方案1】:

    加载图像时,设置抗锯齿标志。
    在 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);
    

    【讨论】:

    猜你喜欢
    • 2021-02-07
    • 2011-05-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多