简体   繁体   中英

Android <alpha> issues… image blinks?

My fade in code works properly, but at the end before transitioning to the main .java file it shows the image again for a second. What could I do to fix this?

FadeIn code:

<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<alpha
android:fromAlpha="0.0"
android:toAlpha="1.0"
android:duration="1500">
<alpha
android:startOffset="1500"
android:fromAlpha="1.0"
android:toAlpha="0.0"
android:duration="1500"
>
</alpha>
</alpha>

</set>

Try setting the android:visibility="invisible" on the ImageView in your layout. If this doesn't work please post the relavent code from your xml layout, and from your java file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM