Alpha animation bug on button
        Posted  
        
            by 
                RaiderJ
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by RaiderJ
        
        
        
        Published on 2012-12-06T23:01:27Z
        Indexed on 
            2012/12/06
            23:03 UTC
        
        
        Read the original article
        Hit count: 344
        
I have animations that fade in a Button (alpha from 0 to 1) and fade out a button (alpha from 1 to 0). This part is all working fine. Button A triggers the fade in of Button B. Button B triggers the fade out of itself.
Button B totally covers up Button A. The idea is that Button B contains an image that is used like an information popup. Button A is touched and Button B fades in on top. When Button B is touched it fades itself out again.
Initially, Button B's visibility is set INVISIBLE and when the fade in animation is complete, it is set to VISIBLE. When Button B is clicked it fades out and then I set the visibility to INVISIBLE.
The problem is that after Button B has faded out, and it is set INVISIBLE, it is still clickable and even though it is not visible, and touches are not received by Button A.
I have tried removing Button B from the parent and re-adding it after the animation is completed, and this allows for touches to reach Button A, but only once. After that button B is not longer touchable.
© Stack Overflow or respective owner