Layout issues with XIB in Xcode 5 (after upgrading app) - ios

I have worked on this application, done 2 years back, using XIB's and Autosizing.
Now, I've upgraded this app (in Xcode 5) & I need to make changes according to iPhone 5 (4") and iPhone 4, 4s (3.5")
I've tried to put Margin layouts but these are not making any difference.
I've created quite a few apps before using similar techniques with out any complication but in this app, the view in iPhone4 has a black cut at the top and bottom of the screen.
![enter image description here][2]

This issue is not related to AutoSizing.
You're just missing the 640x1136 launch image (i.e. Default-568h#2x.png).
Add it and your app should go full screen.
PS: This happened to me when I created an iOS7 project in Xcode 5 and deleted Images.xcassets from the project targets.
reference

Related

Add iPhone X layout support to old Xcode 7 / Swift 2 project

What I have?
An old project using Swift 2 and building/running without any issue on Xcode 7. It has a lot of dependencies and sophisticated architecture which makes it complicated to migrate to swift 3/4 (in a short period of time).
When app is running on iPhone X it has black bars on top and bottom of the sreen (sizing like on iPhone 6/7/8)
What I need?
I need to make the app running on iPhone X without black bars on top and bottom of the screen (fullscreen) without updating whole project. Are there any ways making it possible?
What I've tried?
Making constraints directly to the containing superviews and not the layoutGuide
Removing launchScreen assets and sticking only to LaunchScreen.xib
There are only two ways to remove black bars for a newer device size:
Launchscreen images assets with the new size
Launchscreen storyboard
And, well, you're out of luck, because both solutions require Xcode 9 for iPhone X size support. So you must go for Swift 3.2 at least.

App compiled with Xcode 6 runs on iPhone 5s top/bottom of screen blank

Recently we switched to Xcode 6, and I am having this issue: my simplest tabbed app compiled with Xcode 6 occupies just part of the screen, when it runs on iPhone 5s. There are two black strips sitting at the top and bottom of the screen. Like below:
By default, it looks that way (that is, I created the project using Xcode's template, and compiled and ran it without any modifications). I have also tinkered with various project setting bits, but in vain. Tried creating the project in both Swift and OC, both had the same issue. Never had this problem in Xcode 5.
Can anyone tell what's going on here?
Thanks.
Set up launch images in your app. It is mandatory now for ios 9. Refer this https://stackoverflow.com/a/18913189/3051458
This happens when you dont have the right image assets in your project.
Correctly again drag drop the correct image assets in your project (check the splash images) and it will work.
Dont know why this happened but I suffered from this too ones and then saw the splash images got deleted.

iOS 9 xCode 7 built app displays black rectangle instead of splash screen

I know this question may seem like a duplicate of a few existing ones but its not.
I am struggling with this issue where universal (iPad/iPhone) application does not display the splash screen anymore.
Before upgrading to iOS 9 and Xcode 7, no such issues were present. After upgrading no changes were made to the splash screen in any way.
Tech data relevant to the question:
Supported devices are iPad (landscape only) and iPhone
(portrait/landscape)
I use "Launch Screen.xib" that has an UIImageView with size classes and
constraints set up so that it's always full screen.
I have added all splash screen images in image assets (except iPad
Portrait ones)
I use Xcode Version 7.0.1 (7A1001) and iOS 9.0.2
This issue does not happen on an iPad
The wrong splash screen looks like this on iPhone 5s:
This is made in portrait mode, so there are white squares on top and on bottom of this "black square".
I was struggling with this issue yesterday but I managed to fix it by renaming my launch screen to "LaunchScreen.xib" (without the space). But this morning the issue re-appeared.
Things I've tried:
Removing and creating LaunchScreen.xib again with and without space
Creating LaunchScreen.storyboard file instead of xib
Adding #2x and #3x versions of image used in LaunchScreen.xib
Removing/adding/replacing images in image assets
Cleaning, build cleaning and even deleted derived data
Restarting device, reinstalling app, relaunching without building and many other solutions that I could think of.
Nothing helped, so maybe someone fixed a similar issue already and can lead me to the right direction.
EDIT 1
So I renamed my LaunchScreen.xib image used from "Default.png" to "DefaultSplash.png". This instantly fixed all issues on iPhone. But now I have a new problem - iPad splashscreen is now black. If I set the LaunchScreen image to some other image used in project, the Ipad displays it as splashscreen without any problems, but neither Default.png nor DefaultSplash.png can be used on ipad now. This is really weird issue.
In my case the images in the "Launch Screen.xib" weren't displaying. I had to rename them and reset the new names in the nib file to make it work.
So I fixed the issue like this:
Since I renamed the file LaunchScreen.xib, it fixed an issue on iPhone but caused a similar problem on iPad. Since then, I cannot use the same image file name for the same xib (i.e. if image "Default.png" failed, it cannot be used anyomre... Bug?). So I created two files, LaunchScreen.xib and LaunchScreen~iphone.xib with separate image files for each. Now it works okay.
Seems ugly and buggy but it works.
There is a change in Xcode7 iOS 9 onwards. They have modified Launchscreen(Black screen we will get).If you change deployment target means you can see the previous launch screen. Only empty view controller is present so we have make changes on it.
As per requirement in assets add images in imagecassets.
It may sound stupid but something related to this scenario may happen:
If you hook any outlet and then break it by changing the custom class you will get this black screen behavior without any warning, instead of the typical crash from any non launch storyboard/scenes this will lead to a black screen before the app start.

iPhone 5 storyboard still shows padding when running on iPhone 5

I have made a new app with storyboard, where the storyboard is currently just for iPhone 5. But the issue is, when I run this on iPhone 5 device/simulator, it shows padding at the top and bottom of the screen as if an iPhone 4 application is being run. Please see the screenshot I have attached. And help where did I go wrong.
EDIT : Actually its still not working. In iOS 8 its coming fullscreen but in iOS 7 for some reason the black padding is coming. PLease hellpppp.
EDIT - I got the issue.Apparently, in xcode 6, when Launchscreen.xib is given, it does not work for ios 7 and it works perfectly normal for ios8.
Previous answer - The issue was, in Xcode 6.0, the new project generates a LaunchScreen.xib file, but apparently you manually have to go to the General settings for the target and select the launch screen File options from the drop down. This solves the issues. :)

iPhone 6 - app does not fill screen

Most of my apps scale up when run on an iPhone 6, but for some reason one of my apps looks like this:
What would cause it to not just scale up and fill the screen?
EDIT: Here are some repro steps:
Create a new project (Single View). Turn off size classes and just use iPhone.
Make the background orange.
Add a yellow UIView subview at (20,20,280,200).
In Xcode you get this:
Now simulate on iPhone 6. You get this:
Why doesn't it just scale up and look normal?
Not sure why this is getting downvoted. It's a legitimate question. And here's the legitimate answer:
Remove the "Launch Screen File" in Projects > General. Xcode 5 did not have this so older apps scale up automatically. Apps created with Xcode 6 get a default Launch Screen file created.
Removing it will make your app scale up on iPhone 6.
I have got the same problem and I managed to solve it by adding constraints to my ViewController in the storyboard.
Make sure that you clicked the ViewController of your scene. They yellow button in the this screenshot.
Click Editor-> Resolve Auto Layout issues -> Add Missing Constraints
Now you will find that the background image is scaled up to fill iPhone 6 or iPhone 6 plus.
Note that this solution works for me even if I did not provide any launch screen file.
I had the same issue. Searching for an answer, most of them mention the launch image. To me, what did the trick, was that I first enabled launch image for iOS8.0 and later in Xcode, which requires the native resolution sizes for 4.7" and 5.5". Adding these sizes didn't help, but when I re-disabled them, it started working!
If you do have any launch image, you will need launch images for all appropriate sizes. I was doing a minor update to an app, and it was not showing correctly on the iPhone 6 simulator. I created four launch images (.png files). Since the app should still run on iOS 7, I apparently could not use an asset catalog. I gave the images the correct names, and all is good.
Image sizes and names may be found here:
Sizes and Naming of Launch Image for iPhone app in iOS8

Resources