Iphone Simulator Xcode 6 on IOS 8 visualize two bl

2019-04-10 15:49发布

问题:

I have tried new app in Xcode 6 and not use storyboard. But when I have ran the app, with Iphone 5,5s,6 and 6 plus, in Iphone Simulator visualize two black bars on the top and below. Only Iphone 4s there aren't black bars. Do you have an idea to resolve my problem? Thanks

回答1:

You need to add a Default-568h@2x.png image file that is 640x1136 to your project. I added an all black one that was in an older project. I didn't have to set anything else, which was nice. If you are building for iOS8 and later you can just use the LaunchScreen.xib instead.



回答2:

In my case I was using jpg pictures for the default. Even though I had the correct file names and resolutions, it didn't work. Switching from jpg to png solved it.



回答3:

If you designed the app so that its views had the "old" screen size, and didn't design them to be responsive to different screen sizes, then the phone will add the black bars (known as a "letterbox", I think).