Hide/show toolbar on tap
-
24-10-2019 - |
Question
Because I have an wallpaper app , I want that wehen you open the app there is no toolbar and that when you tap on the screen the toolbar comes , tap again and it goes away. How to do that ?
Solution
You can adjust the toolbar's alpha value like so:
To Hide:
toolbar.alpha = 0.0;
To Show:
toolbar.alpha = 1.0;
Example:
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
// self.navigationController.toolbar.alpha = 0.0;
// or
// toolbar.alpha = 0.0;
[UIView commitAnimations];
OTHER TIPS
In the uiimageview of your wallpaper add a method call touchesEnded: this will be called when you have touched the imaheView. The set hide the toolbat [toolbar setHidden:Yes animated:Yes];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow