Hide/show toolbar on tap
Because I have an wallpaper app , I want that wehen you op开发者_JS百科en 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 ?
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];
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];
精彩评论