Android scale animation flickering

2019-04-12 09:13发布

I have frame layout in my app. In frame I have ImageView and TextView. I need to frame layout bounce all the time.

I've made this animation in xml:

<scale
    android:duration="100"
    android:fromXScale="0.1"
    android:fromYScale="0.1"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toXScale="1.0"
    android:toYScale="1.0" />

<scale
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1200"
    android:fillAfter="false"
    android:fromXScale="1.0"
    android:fromYScale="1.0"
    android:interpolator="@android:anim/accelerate_decelerate_interpolator"
    android:pivotX="50%"
    android:pivotY="50%"
    android:startOffset="100"
    android:repeatCount="infinite"
    android:repeatMode="reverse"
    android:toXScale="0.9"
    android:toYScale="0.9" />

The problem is flickering of the text in text view. ImageView is fine. How to prevent this issue?

1条回答
ゆ 、 Hurt°
2楼-- · 2019-04-12 09:36

I found the solution for this:

in Manifest.xml added hardwareAccelerated.

查看更多
登录 后发表回答