开发者

Android: Fade text in and out within Widget

开发者 https://www.devze.com 2023-04-12 14:42 出处:网络
How can I use a fade i开发者_运维问答n and fade out effect while changing text in a widget? I have the text switching instantly but I would like to fade the text out change it and then fade it back in

How can I use a fade i开发者_运维问答n and fade out effect while changing text in a widget? I have the text switching instantly but I would like to fade the text out change it and then fade it back in again. I have tried using loadAnimation, but widgets don't seem to like that.

Any help on how I can get this working will be really appreciated.

Thank you :)


You can animate a property of the TextView with property animation. In your case you'd animate the alpha property.

Since you ned to fade out, change text and then fade in, you'll need two animations.

0

精彩评论

暂无评论...
验证码 换一张
取 消