0

I am working with xCode7 and I am trying to not use storyboards. I have deleted both the launch screen and the main storyboard properties from info.plist and I have created a xib file that is properly linked to the view controllers. In my app delegate I have written the following code:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

CGRect screenBounds = [[UIScreen mainScreen] bounds];

UIWindow *window = [[UIWindow alloc] initWithFrame:screenBounds];
ViewController *vc = [[ViewController alloc] init];
[window setRootViewController:vc];

[window makeKeyAndVisible];

[self setWindow:window];

return YES;

}

My xib file looks like this in the editor:

enter image description here

Those buttons are there to show the top and bottom.

In the simulator it looks like this:

enter image description here

Can anyone throw some light into the matter? Thanks, P.

Community
  • 1
  • 1
Paul
  • 1,277
  • 5
  • 28
  • 56
  • The issue is that in the absence of the launch screen storyboard, it's using the presence/absence of launch images to determine what screen resolutions to support. Effectively, what you're seeing is it's attempt to render a 3.5" or 4.0" app on a larger device. If you add launch images for the appropriate device sizes, it should size the app properly. See http://stackoverflow.com/questions/32641240/ios-9-xcode-7-application-appears-with-black-bars-on-top-and-bottom or search for [black bar on top and bottom](http://stackoverflow.com/search?q=%5Bios%5D+black+bar+on+top+and+bottom). – Rob Jun 05 '16 at 23:23

1 Answers1

0

This looks like you should take a look into your Top Bar and Bottom Bar. Make sure is none. I hope this can help you.

[viewController.navigationController setNavigationBarHidden:YES animated:YES];

and

[viewController.navigationController setToolbarHidden:YES animated:YES];

I didn't test it on xcode, maybe there is some errors in my code. I hope this can help you.

J. Lopes
  • 1,336
  • 16
  • 27