Removing launch screen file from Info.plist scales the views - ios

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.

Related

Device Layout Does Not match Simulator or Storyboard

I've been away from Xcode for a while, so I may have missed changes in the latest couple of releases. The layout of views looks identical in the Storyboard, and on the simulators (iPhone6 and iPhone7), but different on my iPhone 6. I have no warnings or errors in the Storyboard, and I am using Xcode 8. The device acts as if it had a shorter screen than the simulator -- things that are spread appropriately on the storyboard or simulator, are squeezed together vertically on my phone. What is the reason for this difference?
Have you assigned launch images with the correct dimensions for the different form factors? An easy way to verify this is to add a print statement in a view controller to see what the bounds are for the screen. Verify that these values match what you expect for the device.
The following from Apple documents this:
Because device screen sizes vary, launch screen sizes vary too. To
accommodate this, you can provide a launch screen as an Xcode
storyboard or as a set of static images for the devices your app
supports. Using an Xcode storyboard is the recommended approach, as
storyboards are flexible and adaptable.
While not an official Apple site, this link also references this as a potential issue:
The launch XIB or storyboard is required to support iPhone 6 sized
apps.
Another possibility is that you have the screen zoomed in on the device. To change this, go to Settings > Display & Brightness and select Display Zoom at the bottom. Ensure that you have Standard selected. If you are zoomed in, then the device will scale down (A 6 behaves like an SE, a Plus behaves like a 6/7).

SceneKit scene being letter boxed on larger screens

After upgrading my test devices to iPhone 6s and 6s Plus I am getting a letter box effect on the sides (while the phone is being held horizontally) of my view. (My project is horizontal orrientation only)
This should be a simple fix of the constraints of the view. However this project was started over 2 years ago and I believe I may have used an Apple sample app to get started.
Therefore I'm at a loss to where such settings would be altered. I can easily change the SpriteKit overlay to match the screen with the appropriate key but as SceneKit is reliant on the view and the view is hidden due to my lack of knowledge in this area I cannot.
TL; DR:
To avoid letterboxing, you need to supply an Interface Builder launch screen (either .xib or .storyboard).
Background
When the iPhone 5 (the first to have a screen larger than 320x480 logical points) came out, Apple deviced a method for the system to tell if the app had been built with that screen size in mind, or if it was "legacy".
In addition to launch image of 320x480 (typically named Default.png, Default#2x.png for retina), you had to supply an additional one of 320x568 points (640x1136 pixels) for 4 inch displays.
If the system couldn't find that, the it would assume a "legacy" app and run it with black padding above and below the view, that is its "intended" size of 320x480 (so that the layout didn't break).
After that, the iPhone 6 and 6+ came out and using fixed bitmap images for launch screens became more and more meaningless; Apple wisely introduced xib and storyboard-based launch screens to support multiple screen sizes (e.g. with autolayout).
I haven't seen it first hand (because I adopted launch storyboards before getting my hands on a 6/6+), but I assume the same kind of letter-boxing happened for apps desiged with -at most- the iPhone 5/5s in mind (i.e., bundling a 4-inch ready launch image but no dynamic launch screen), and this is what happened to you this time.

iOS Replace the default Keyboard with a shorter Keyboard

How can I get the default keyboard to be shorter like the keyboard on the right?
The standard keyboard is the left, how do I get it to have the height of the one on the right?
The left keyboard is not taller than the right keyboard— they are the same height, in points. The difference is in the scale of the screen; i.e. the pixels are smaller on the right. Assuming that these are the same device, the difference is caused by one of two things:
The app on the left is not updated to support the higher resolution screens of the iPhone 6 and 6+. To remedy this, you can either specify a .xib as your "Launch Screen File" in the target's General settings, or add a launch image for iPhone 6 and 6+ to your asset catalog.
The app on the left is running on a device which is in "Zoomed" view mode. To change this, follow this path in your Settings app: General > Display & Brightness > View.
Edit: A good tip for recognizing such resolution differences (on an iPhone 6 or 6+) is to watch the clock as an app launches. If it gets bigger, then your device is set to the "Standard" view mode, and the application has not been updated to support iPhone 6/6+ resolutions. If the clock stays the same size, then either the app has been updated to support iPhone 6, or the device is in the "Zoomed" view mode (or both).
You cannot control the height of the keyboard. The keyboard on the left is looks taller because this app hasn't been updated for iPhone 6/6+ screens, so the keyboard and everything else in the app has been stretched.
See this question for how to support the new 6 screen sizes.

Resize app designed for Iphone 6 to scale correctly in iphone 5s

Ok, here is the problem I have designed an application for iphone 6 screen without size classes and autolayout.
Looking like below in the storyboard. As you can see its simulated size is 4.7 inch.
It works perfectly when running on iphone 6 devices obviusly.
However when trying to run the app in other devices than iphone 6 it wont scale proportional.
My hope was that if I removed the lanuch screen images only keeping the iphone 6 size it would scale to fit other screens looking the same as if it where run on a iphone 6 only scaled up or down depenging on device.
My launch screen looks like this now
It does infact scale the app but it scales the app in wrong proportion making it looked chopped like this.
Iphone 5s version of the app looks like this
As you can see it scales correctly but the aspect gets wrong compared to the iphone 6 version below scaling correctly.
Here is an ipad version looking like the iphone 5s version scaling wrong.
It seems to me that the scaling works since I have removed all launch images except the 4.7 display (iphone 6) The problem however seems to be that it scales keeping the aspect of an iphone 5 in width making the iphone 6 display to wide.
I have tried to add launch images for all devices but the problem then is that I need to use autolayout and size classes to make it work.
Is there any way to for instance tell the scaling to keep aspect but use iphone 6 width and height intact without using size classes etc.
To make the question even more simple. Is there any way to scale an app made for strictly iphone 6 so resize to iphone 5s/ipad?
Any help is highly appreciated!
Well, the "trick" with removing the other launch images doesn't work, as you noticed yourself.. This automatic scaling only works from 4" to 4.7" and 5.5" and is only to support older apps on the new devices, not for general purpose "I am too lazy to support all sizes" use cases.. ;-) Apart from that, you should definitely support the native resolutions.
So, to answer your question: You can either just use Auto Layout. This is definitely the preferred approach - after all that's exactly the use case that it has been built for.
Alternatively, if you really don't want to or can't use Auto Layout, you either need to make sure to set your auto resizing masks correctly (e.g. "flexible width" on the stuff that needs to grow/shrink horizontally etc.), or adapt your frames manually in code (which partially defeats the purpose of IB).
If you didn't use Auto-Layout or Size Classes, your only hope is to programmatically change the positions/size of each element individually in the viewDidAppear or viewDidLayoutSubviews method of your LoginViewController. You would have to do it also on orientation change (if your app supports it).
It's a lot of work that can be easily be avoided by using Auto-Layout/Size Classes!

Autolayout not working on iOS7 and Xcode 6

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.

Resources