Autolayout not working on iOS7 and Xcode 6 - ios

I've started using Xcode auto layout for my projects.
Auto-layout works perfectly when I'm testing on ios8 devices, it the view scales as needed.
However, things get a little crazy with ios7.
When I test my app on an ios7 iPhone 5 simulator, the app doesn't scale-up to the larger screen,
but only shows the 3.5 inch view, leaving black bars on the top and bottom of the screen.
I am using a tableView controller.
How do I scale the tableViewController up so that it fits on a larger screen in ios7?
(Like I've said, my app fits perfectly in ios8, on all screen sizes, but not in ios7.
Also, it scales fine on an ios7 ipad.)
thanks.

The Xcode (6) IDE should give a warning about this, that may not be so clear:
"Applications using Launch Screen Files and targetting iOS 7.1 and earlier
need to also include a Launch Image in an Asset Catalog."
This means you need to have the proper Launch-Images for the "Retina 4" screen,
which is 640 × 1136 pixels, and it should be configured in the assets-catalog,
just like your Application-Icons ("AppIcon"), but under "LaunchImage" there.
Once you add this 4-inch-compatible Launch-Image to your application,
iOS-7 will assume you are properly supporting the "Retina 4" screen,
and will launch the application in 4-inch mode.

Related

Removing launch screen file from Info.plist scales the views

I noticed something that when you remove the launch screen file entry from the XCode Info.plist file, any view of any view controller becomes scaled according to the screen size, so the views appear zoomed in on large screen sizes such as the iPad Pro (12.9 inches) and appear somehow zoomed out on smaller devices (iPad Pro 9.7 inches).
In that case it seems that the Auto Layout constraints have no effect as the scaling is done automatically.
I really can't understand what does this has to do with the layout constraints, so I appreciate if any one can explain what's the reason for that.
Without being able to provide deep details, iOS uses the launch screen definition (view or static images) to determine which size classes the app should use. If you have not supplied those, it seems you get scaling that you generally do not want.
That doesn't mean auto-layout no longer has any affect... it just means that the auto-layout engine is not using the current screen size for its size/positioning calculations.
You'll see very similar results if you explicitly set your project for iPhone only.
Simple, obvious solution: Don't remove the launch screen.
Yes this is expected behaviour... Same is for iPhone 6 Plus. If you remove the iPhone 6 Plus launch screen, it will display the iPhone 6 scaled version.
This is just for backward compatibility. If your app is not ready for iPad Pro or iPhone 6+, scaled version can be used by removing the respective splashing screens.
All current iPhone apps or iPad apps in AppStore those are not optimised runs as a scaled version.

Xcode 7.1.1 UINavigationBar does not cover the entire width of the screen with iPhone 6 and above

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.

Window size small on iPhone 5/6

I have having ass issue with an iOS8 app, I use auto layout but not size classes in my storyboard. My app works as expected in iPhone 4s and on iPhone 6+ but when viewed on an iPhone 5/5S/6 the window seems to be the wrong size, I get a black border at the top and bottom of the screen. I have attached a screenshot below. What could cause this? I have never encountered it before..
You are missing the correct size of launch screen for 4" and 4.7" devies. If you have them in your project make sure they are in the list of launch screen in te info.plist. If you are using image assets make sure they are present in the LaunchImage section.

ImageView Scaling for iPhone 6 and 6+

So Im making a game without the use of auto-layout. I have used constraints to scale everything and it worked perfectly. However, there are 12 image views that scroll down. 6 on the right a 6 on the left.
This is done based on a code i've written and places the images via arc4random.
The images on the left are completely fine and scroll down so that there is no gap between the side of the screen and the image. As do the images on the right when using the iphone 4s and 5.
HOWEVER.. when it comes to trying this on the iphone 6 and 6+, alot of the times, there is a gap between the image and the side of the screen on the RIGHT. the LEFT is fine. I want to know how I could solve this issue. This is more of a general problem so dont need to include code.
You can try disabling iPhone6 and iPhone6 Plus support for the app so that they work fine on the new devices (via scaling)
Remove "Launch Screen File" from Target General Settings and if you are using Asset Catalogs for Launch images, under right panel for the asset catalog under Launch Images-> remove launch images for iPhone Portrait and Landscape for the category 'iOS 8.0 and later'
This is a workaround that makes iPhone6 and iPhone6Plus to scale views according to the screen size.

Strange screens in iPhone5s 7.1 simulator

I have xcode 6 and target is 7.0.I am having no problem with other simulators.But in iPhone5s7.1 the screen has black top bar and bottom bar
If you use #2x.png files by default, then I'm sure that your app will look good on iPhone5s and other retina devices.
as #WonderMonster answer you will have to make #2x size images
Read this https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html
This is because the iPhone 5s has a taller screen than the iPhone 4 and earlier. Most likely you are setting your view to a static size rather than setting it to dynamically resize.

Resources