Black bars showing when running app on iOS 7 (4 inch retina display)

浪尽此生 提交于 2019-11-26 01:39:06
Nitin Gohel

First thing is that you must add the required default image for 4 inch screen display. Check Properly in you project have image with name Default-568h@2x.png (640 × 1136 pixels)

This Default-568h@2x.png is Necessary for Support app in 4 inch Screen display

Ones you add this image in to you working Project, Remove old Build from device or Simulatore, clear Project and re build and check Hope you issue will solve.

Edit:-

After fix the black Bar issue you can check the device like my answer Give here check this:-

Detect device type

you have two choice if you can't use AutoLayout

First

Create two xib with same class one for 3.5 inch screen and one for 4 inch screen set using macro with checking which screen appear.

Second

Set Self.view frame using macro with checking which screen appear.

There are also other methods you can use for set self.view frame as using window frame or UIScreen

My problem was I accidentally deleted the value found here:

I added back LaunchScreen, and made sure there was a LaunchScreen.xib. Maybe it will help some others.

Ive had the same problem - black bars at the top and bottom. It was simply solved by setting the drop down in "App Icons and Launch Images" to Main_iPhone:

App Icons and Launch Images Screen Shot

Same problem. For ios 8.1 check whether the launch file is configured properly in the main configuration window. For ios 7.1 ensure that the launch image contains 640x1136 image.

This will clear the black bar problem on both ios when running in simulator.

JayJohnAdams

Mine was even easier to fix. I only typed LaunchScreen in the Launch Screen File field.

  1. Click on the Project file in Project Navigator
  2. Click General tab
  3. Type "LaunchScreen" in the Launch Screen File field
  4. Save

I was facing same problem . I just added launch image and it worked for me.

XCode->Click on Project File -> Select Target-> App Icons and Launch Images -> Add launch image source

Edwin Ikechukwu

This worked!

Pay attention to Step#5 and Step#6 below:

1.In xcode, Click on the Project file in Project Navigator
2.Click General tab
3.Type "Main_iPhone" in the Launch Screen File field
4.Save
5.Remove the app from device or simulator
6.Then in Xcode go to Product Menu and then select Clean 
7.Build again 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!