0

I created a simple project but I deleted the storyboard and the xib file (screenshot) then I lunched my application from the 'AppDelegate' and I got unusual result in the screen as you can see in the link on the bottom.

why the status bar is not in the top and why there are two padding in black ?

this is my 'AppDelegate' code :

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
    self.window.rootViewController = [[MainViewController alloc] init];
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    return YES;
}

link : first screen

  • Did you delete `LaunchScreen.storyboard/xib` also and are running this on iPhone6/6+ (or 6s, or 7)? This may be due to the fact that without `LaunchScreen.storyboard/xib` or compatible LaunchScreen images your app gets run in a kind of "compatibility" mode. – Losiowaty Jan 13 '17 at 08:09
  • I runed it on iPhone 6/6s/7 and it's always the same result –  Jan 13 '17 at 08:14
  • even in the simulator it's the same result –  Jan 13 '17 at 08:15
  • And did you remove the `LaunchScreen` files? – Losiowaty Jan 13 '17 at 08:26
  • yes i did remove it –  Jan 13 '17 at 08:30
  • Without these files or an launch image in correct resolution, the system will assume that you haven't adjusted your app to new devices and this may be the cause of it. – Losiowaty Jan 13 '17 at 08:32
  • 1
    Possible duplicate of [Black bars showing when running app on iOS 7 (4 inch retina display)](http://stackoverflow.com/questions/18913105/black-bars-showing-when-running-app-on-ios-7-4-inch-retina-display) – Kreiri Jan 13 '17 at 08:34
  • So you are suggesting that I made a new ones ? –  Jan 13 '17 at 08:35

1 Answers1

1

Add the Launch Screen as Follows File > New > File > iOS > User Interface > Launch Screen then your app start work fine

Gurinder Batth
  • 655
  • 9
  • 18
  • That works thanks but I added the launch screen to my info.plist –  Jan 13 '17 at 08:39
  • I know this issue yesterday i worked on it same way as you but didn't work so i do in this way i this it is iOS error – Gurinder Batth Jan 13 '17 at 08:40
  • yes it is . But what if I want to create my launch screen by code and not by UI ? –  Jan 13 '17 at 08:42
  • we can't but you have to create controller and call it in didFinishLaunching but it will take 5 sec to load because in iOS by default launch screen time is ~5 Seconds after that you can add your custom screen – Gurinder Batth Jan 13 '17 at 08:53