Gap left by setStatusBarHidden:YES in Utility Application
Bryan Wills
10 posts
|
I have created a basic Cocoa Touch “Utility Application” and I am attempting to remove the status bar and set the orientation to landscape using the following code in my TestAppDelegate.m file (not sure if that is the right place to put this code btw):
- (void)applicationDidFinishLaunching:(UIApplication *)application {
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];
[[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeRight animated: NO];
[window addSubview:[rootViewController view]];
[window makeKeyAndVisible];
}
I also added the UIStatusBarHidden/true (Key/Value pair) to the info.plist file (which may be redundant with the above code?) I further went into IB for the 3.xib files that default with the app and set any reference to Status Bar to “none”. The status bar disappears, and the iphone in the simulator rotates to a landscape orientation, but there is approximately 20 pixel gap above the MainView and the FlipsideView that I can’t seem to get rid of. Here are some screen captures of what I am seeing on both “sides” of the app: http://dev.oneinchpunch.com/iPhoneGap.jpg So here are my questions: Thanks in advance for your help. -B |
Bill Dudney
372 posts
|
Hi Brian, Is your view set to autosize in the vertical direction? That could be preventing it from taking up the final 20 pixels. Good luck! |
Bryan Wills
10 posts
|
All views in all 3 xib files in IB have all the springs and struts turned on in the View Size > Autosizing inspector, is that what you mean? Not sure if there is somewhere else I need to be setting that. A-HA! (as in eureka, not the band from the 80’s) I figured it out, mid-post. It was actually the way I set the “UIStatusBarHidden” value in the info.plist file. I had it set to “true” which is considered a string by that file. For anyone else running into this issue, in your info.plist file you have to “right-click” (ctrl-click) on the key and set the Value Type > Boolean. Then enable the checkbox that appears. Thanks Bill for your quick response. |
jaime de la ...
1 post
|
I have a similar problem, in my case, the views are loded by code and are displayed correctly, but what happens is that the 20 pixels don’t react to touches. I have tried with the code above, and also editing the Info.plist . I have read other people are having the same issues (that’s how I got here), but I haven’t found the answer. Edit: OK, it seems it’s a bug in the emulator, it still holds in Xcode 3.1.2… |
4 posts, 3 voices
