How can I make the main content view of my app full screen, and show the toolbar only when the user touches the screen and one more touch will hide the toolbar? kind of like the ibooks app?
also how do I make a toolbar transparent?
How can I make the main content view of my app full screen, and show the toolbar only when the user touches the screen and one more touch will hide the toolbar? kind of like the ibooks app?
also how do I make a toolbar transparent?
To make content view of your app full screen just set [[UIApplication sharedApplication] setStatusBarHidden:YES];
To hide/show : Identify the tap area of status bar when clicked set - [[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES];
.
To make it transparent use [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent];
Out of interest, are you using a UIWebView
? Because that makes life more tricky, because you need to detect tap views to the UIWebView
. There are four main ways of doing this.
UIWebView
. Not recommended because Apple tell you not to do this.UIWindow
. I found this to work very well - until I needed to rotate to landscape, which it wouldn't let me do! I'm still trying to find a solution to this. In any case, see http://mithin.in/2009/08/26/detecting-taps-and-events-on-uiwebview-the-right-way/ .UIView
on top of the UIWebView
, but I think this also involves subclassing and is not recommended. I have never tried this.UIWebView
(through changing document.location
in the javascript, then intercepting the URL request through the Objective-C code, denying access, and using it to do the things which Chandan Shetty SP suggests above.However, if you are not using a UIWebView
, this post is irrelevant.