【发布时间】:2018-01-30 14:47:42
【问题描述】:
我有一个类似于this 的问题,但我只想让按钮上的文本闪烁。我不希望按钮背景也闪烁。
这是我的 R.anim.blink.xml 文件:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha android:fromAlpha="0.0"
android:toAlpha="1.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:duration="500"
android:startOffset="20"
android:repeatMode="reverse"
android:repeatCount="infinite"/>
</set>
但是这段代码...
Animation blinkingAnimation = AnimationUtils.loadAnimation(this, R.anim.blink);
myButton.setAnimation(blinkingAnimation);
...使整个按钮闪烁。那么如何让文本闪烁(所以按钮背景一直显示)?
【问题讨论】:
标签: android android-animation android-button android-textattributes