Android 缩放动画闪烁 [英] Android scale animation flickering

查看:72
本文介绍了Android 缩放动画闪烁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用中有框架布局.在框架中,我有 ImageView 和 TextView.我需要一直框架布局反弹.

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

我已经在 xml 中制作了这个动画:

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" />

问题是文本视图中的文本闪烁.ImageView 很好.如何防止这个问题?

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

推荐答案

我找到了解决方案:

在 Manifest.xml 中将 hardwareAccelerated 设置为 true.

in Manifest.xml set hardwareAccelerated to true.

这篇关于Android 缩放动画闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆