I didn't find any solution for my problem anywhere in Stack Overflow or other sites. So here is the problem:
I am developing an iOS Universal app, portrait orientation only. When I run it on iOS 8.3 simulator window and all other views layout seems to be normal.
But when I run the same app on iOS 7.1 simulator, which I downloaded from developer's site for Xcode 6, the window height seems to be approximately 100 px smaller.
I checked the couple of view frames for both simulators.
7.1 simulator was returning width = 320, height = 480
8.3 simulator returned width = 320, height = 568
I am using storyboard and constraints.
I am pretty sure that a lot of people had this problem, so I am hoping to hear some useful advices from you.
Check out the screenshots below:
Added Answer as per Brian Tompsett - 汤莱恩's Suggestion.
Solution is already done on comments.
iOS 7.x does not support LaunchScreen.xib
So, Manually add the LaunchScreens in the assets folder and you will get desired output.
Go to Project settings --> Target --> App Icons and Launch Images
Launch Image Source was empty so, open it and chose to Migrate from Images.
So now window height is back to 568 on iOS 7.1 simulator
Related
Problem
I have a Controller in Storyboard which has a long UIScrollView inside. Previously it shows perfectly in Interface Builder and now I haven't changed the code. The last time I knew that I updated Xcode to version 11.0. I don't quite know why it fails to render, is it some issue in Xcode 11?
If I compiled, it's success with 0 error and some warning (Which seems me to some Swift deprecated). Even it shows perfectly in Compiled App. I have tried:
Clean Build
Delete Derived Data
Reopen Xcode
Rebuild
Restart OS
Edited after some experiment
Okay, so I tried a bunch of things again and I think I narrowed some problem (maybe?). So my layout show perfectly in iPhone 11 preview, but it fail to render in iPhone 11 Pro Max, iPhone 11 Pro and iPhone 8 Plus preview. Is it ringing any bell?
iPhone 11 screenshot:
iPhone 11 Pro Max screenshot:
iPhone 8 Plus screenshot:
Obviously a change in storyboard previews in Xcode. Seems like it's no longer acceptable to show "simulated size: freeform" greater than iPhone screen height. Changing it to "simulated size: fixed" in Size Inspector solves the issue, and you can now scroll from within the reduced size window in storyboards view...
My app was acting fine till I updated my Xcode. For some odd reason, my UINavigationBar is no longer covering the entire width of the screen for devices iPhone6 and above.
For iPhone 5:
For iPhone 6 and above:
I think you didn't used autolayout. Okay no problem..
Follow below steps:
1. you need to keep it empty on Launch Screen file.
2. Create Launch image source and then add iPhone 6 and 6+ splash screens
Then it will work your navigation bar automatically fit based on device.
I have XCode 6 project built with target OS as iOS 8.1 (I don't see earlier target in XCode).
All my view controllers are designed for iPhone 4 inch size. I see correct size when I launch my app on simulator (iOS 8).
However I get iPhone 3.5 inch layout on my iPhone 5C (4") - running iOS 7.1.1 - no matter what changes I make to storyboard. I tried changing storyboard settings like IB version to iOS 7.1 and later and so on, but to no avail.
The app runs totally fine, except that the top & bottom spaces appear black on my device - total height = 480 instead of 568.
What can be the reason?
The solution - as suggested by a kindred spirit on Apple forum:
Include a 4" launch image to the asset catalog
Clean up the project, delete derived data, delete the app from device
Re-Run the app on device.
320 X 568 screen is there...woohoo....
My ios app does not fit on iphone 5 screen. When I run the app, I can see blank space at the top and bottom of the screen. I have made the app compatible for both iphone sizes. But Since I have updated to the latest xcode, I am facing this issue. See screen shot. Can any one please help?
You probably may not have set your Default-568h image.
On the simulator make sure you have set to iPhone (Retina 4-inch).
You can do this by going simulator menu at the top go to Hardware->Device->iPhone (Retina 4-inch) that will change the phone simulator to the iPhone 5 version.
click here for more get information for naming convention of images [here]Naming convention for iPhone 5 images? [here]
Try setting AutoresizingMask to your container views instead of assigning appFrame.
I have faced the same problem while moving to iOS 7.
Solution comes with AutoresizingMask. iOS 7 has full Screen layout for ViewControllers.
I am designing my iPhone app using storyboard and auto-layout. Everything works fine in iOS 7 on both 4 inches and 3,5 inches device.
On iOS 6.1 the app runs like is always on 3,5 inches device, even if is running on a 4 inches device, the black bars on top and bottom appears.
screenshot on the simulator:
Anyone with the same issue? how can i solve this problem?
I think are you Forget to adding splash screen Default-568h#2x.png in to you Project please check Property and set required splash-screen Default-568h#2x.png (640 × 1136 pixels)
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.
Yes, i'm agree with Nitin. In XCode 5 just create e new LaunchImage Set and add the standard, retina and R4 image in both iOS version (5,6 and 7).
Remember to set this set as default in your project info.
A quick fix is to replace Launch Images with your Storyboard.
In Xcode, go to Target > General, and then: