========================================================== ================================
When creating an image wallpaper application, you need to hide the tab and navigation bar at the bottom of the wallpaper. These systems are all animated.
Then, I added the like button to the wallpaper and set its hidden to work with the dynamic hiding of tabs.
[Cpp]
Button. hidden = YES;
Button. hidden = YES;
However, it is found that the button is instantaneous and does not match the tab animation.
Therefore, an animation is added to the hidden action of the button. As follows:
[Cpp]
-(Void) hidden {
CATransition * animation = [CATransition animation];
Animation. type = kCATransitionFade;
Animation. duration = 0.4;
[Button. layer addAnimation: animation forKey: nil];
Button. hidden = YES;
}
-(Void) hidden {
CATransition * animation = [CATransition animation];
Animation. type = kCATransitionFade;
Animation. duration = 0.4;
[Button. layer addAnimation: animation forKey: nil];
Button. hidden = YES;
}
You only need the above code for each hidden operation.