3

Could you please tell me why a brand new project created in Xcode 6 looks with two black bars from top and bottom of the screen on iPhone with 4-inch display ios 7?

Popeye
  • 11,839
  • 9
  • 58
  • 91
user-123
  • 874
  • 1
  • 13
  • 34
  • Voted to close do to lack of research done here. There are hundreds of questions that have been asked in relation to this please do a little bit of research before asking a question. Literally took me 2 seconds to find hundreds of questions http://stackoverflow.com/questions/18913105/black-bars-showing-when-running-app-on-ios-7-4-inch-retina-display – Popeye Oct 15 '14 at 12:15
  • Thanks! Sorry, did not find it.. – user-123 Oct 15 '14 at 13:15
  • 1
    Please also be aware of the conversation between me and @TeeJay below his answer. Whilst this has never happened for me xcode could generate files that should enable it for iPhone 4-inch I would advise to keep watching his comments/answer as they may provide more information for this. – Popeye Oct 15 '14 at 13:26

2 Answers2

1

As described in comments, the solution is to add a LaunchScreen.xib and setting it as Launch Screen File in project's settings.

Naftic
  • 111
  • 6
-2

You might want to take a look to Size Classes.

Or just disable size classes.

Teejay
  • 7,210
  • 10
  • 45
  • 76
  • 1
    Incorrect and will not help they are missing the `Default-568h@2x.png` which makes it so the iPhone 4-inch will pick up to use full screen so -1 – Popeye Oct 15 '14 at 12:17
  • I missed the part where we are taking about Default screen...? – Teejay Oct 15 '14 at 12:19
  • It is pretty obvious that is the issue because that is the only time you will get a black bar on the top and on the bottom without actually doing anything so my -1 remains. – Popeye Oct 15 '14 at 12:21
  • XCode should automatically create a Default screen (actually a XIB) size-classed – Teejay Oct 15 '14 at 12:22
  • XCode from version 6 create a default XIB that you can use as Default Image, just try yourself. – Teejay Oct 15 '14 at 12:27
  • `xcode 6` has never done that for any new project I have started. I know you can use XIB and/or storyboard instead of static image as it is in the HIG but I've never had one auto generated for me and the HIG states nothing about one being auto generated. Is this a project template specific thing or an option that needs checking? – Popeye Oct 15 '14 at 12:32
  • If I remember well, last time I used the "Empty" template copied from Xcode 6 preliminary beta 2 (the one provided here http://www.reddit.com/r/iOSProgramming/comments/2a3jyr/xcode_6_beta_3_removes_empty_application_option/) – Teejay Oct 15 '14 at 12:43
  • I normally start an empty project and use the code snippets to add my default code in and I've never had this file generated for me, to be honest I don't like files being generated for me I'd rather do it myself because I don't fully trust the generated stuff. – Popeye Oct 15 '14 at 12:48
  • Me too... But I recently started a new project and I didn't take too care of the Default image. – Teejay Oct 15 '14 at 12:52
  • If it is in there and you can provide something to say that they should be auto generated then I am more then happy to remove my -1 – Popeye Oct 15 '14 at 12:54
  • At home, I'll look into that. – Teejay Oct 15 '14 at 12:57
  • Ok I have removed my -1 until you are able to provide additional information (Note it required me to do a small edit to your answer so I could remove the -1) – Popeye Oct 15 '14 at 13:27
  • @Popeye On xCode 6.0/6.1 I tried to create a new project with Single View Template in Swift. It automatically creates the LaunchScreen.xib as you can see here: http://i60.tinypic.com/2z4ahht.jpg – Teejay Oct 24 '14 at 11:53
  • @Popeye Xcode 6 generates a default xib for the launch screen. It's done this since the option for resizable classes was announced.... you are completely wrong in your notion that it doesn't (and I have a ton of projects I've had this done on). On Xcode 7 it doesn't seem to do this (yet?), providing the fact that once you switch the Launch Screen File to a manually created launch screen xib in the general app settings, everything will now resize correctly. I will also note that prior, Xcode generate a black splash screen for the required sizes. Developers have never been required to add theirs – TheCodingArt Jun 10 '15 at 20:13
  • @TheCodingArt it has been a while since I have done any iOS development so my comments here are purely based on iOS 7 and below. Developers were required to add there own default images (Launch Image) this was stated in the `Apple iOS Human User Interface Guidelines` and if developers didn't comply to this their app would be rejected under ruling **10.1** of the Apple Review Guidelines. If you tried to submit an app that didn't have the default launch image xcode would reject it at submission. Unfortunately I can't find the old documentation that states this but it's not really an issue. – Popeye Jun 11 '15 at 07:53
  • @Popeye, this isn't true. I have apps that have been released with the default black images provided by apple. These suffice enough to cover the requirements. It is recommended though to have a custom image. This includes in iOS 6 and 7 days with Xcode 5 and 6.Xcode 3 I'm unsure of to be honest. – TheCodingArt Jun 11 '15 at 11:28
  • @TheCodingArt I've had a app rejected because of this very reason, launch images at one time were mandatory and pe-iPhone 6 when the iPhone 5 was released if you didn't include `Default-568h@2x.png` your app would run with a black bar on top and on the bottom, pre-iPhone 5 if you didn't include the `Default@2x.png` your app would run in standard resolution. So at one time these served there purpose and missing them out would create a bad user experience and make things look bad. If you do some research for the iOS 6 (Maybe iOS 7) documentation you will see that it was required. – Popeye Jun 11 '15 at 11:59