开发者

Android AlphaAnimation causes black box

开发者 https://www.devze.com 2023-01-07 21:51 出处:网络
I\'m applying an AlphaAnimation to a Button.The animation is extremely simple. <alpha xmlns:android=\"http://schemas.android.com/apk/res/android\"

I'm applying an AlphaAnimation to a Button. The animation is extremely simple.

<alpha xmlns:android="http://schemas.android.com/apk/res/android"
       android:interpolator="@android:anim/accelerate_decelerate_interpolator"
       android:fromAlpha="1.0" android:toAlpha="0.0" android:duration="500"/>

On the emulator, the button fades out nicely with no discernable artifacts. On actual devices (Nexus One & Motorola Droid), there is a noticeable black artifact from the actual frame of the button.

Is there any way to avoid this? It looks like crap.

Emulator:

Emulator http://img.skitch.com/20100716-e66fgyg4pdyium15cu4e4ijr9c.jpg

Device:

alt text http://img.skitch.com/20100716-fhs149r5ftkm3pte1sajkfnabh.jpg

(Images have been docto开发者_如何学运维red because it's hard to capture the same fade state during an animation, but that's exactly what it looks like)


I'm assuming the answer is that Android does a crap job of cross-fading. Marking this as the answer for lack of a better explanation.

0

精彩评论

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

关注公众号