Xcode 6 Bug? Adding iPhone 6/6 Plus LaunchImage Changes App Constraints - ios

I have my project setup on AutoLayout, works fine with iPhones 4 - 6 Plus. However, when I add in the LaunchImage for iPhone 6 and 6 Plus, the frames and constraints for the entire app no longer take up the entire screen. Instead, the entire app fits in the top left area of the screen.
If I remove the LaunchImages for iPhone 6 and iPhone 6 Plus, then the issue goes away and the elements of each View Controller once again have the correct coordinates and sizes.
I am using the following in Images.assets:
- 2x iOS - Portrait 7,8
- Retina 4 - Portrait 7,8
- Retina HD 5.5 Portrait iOS 8
- Retina HD 4.7 Portrait iOS 8
There are no warnings regarding the asset catalog, and all the LaunchImages are at the correct dimensions. I have attempted to Migrate the images over but with no luck.

When you don't provide iPhone 6 and iPhone 6 Plus launch images, iOS 8 simply scales your interface up (makes everything larger to fit).
Once you provide those images, you will now have access to the larger screen resolutions, and just because you use auto-layout, does not mean your views will resize. If you have constraints that are limiting the height and width of your views, you will get what you are seeing. I would check on your constraints on your views to make sure they are done properly and allow the view to grow when the screen size is larger than 320 x 568.

Related

Launch Screen Image size for all iOS screen sizes

I am trying to create a lunch screen image for my iOS app. But I am not sure whats the right size for it.
According to apple website for iPhone 6 the size should be 750 x 1334 (#2x) for portrait.
But my question is, how to create a launch screen image that will fit for all screen sizes such as iPhone 5, 5s, 6, 6 plus, iPads etc?
Whats the correct way of doing this?
Go to images.xcassets
there you can see launch image sizes.Just Enable iOS version from right side.
iPhone Portrait iOS 8:- 1242*2208 (5.5 inch)
750*1334 (4.7 HD)
iPhone Landscape iOS 8:-2208*1242 (5.5inch)
iphone Portrait iOS 7,8 :- 640*960 (#2x)
640*1136 (Retina)
iPhone Portrait 5,6 :- 320*480 (#x)
640*960 (#2x)
640*1136 (retina4)
But my question is, how to create a launch screen image that will fit
for all screen sizes such as iPhone 5, 5s, 6, 6 plus, iPads etc?
That will be very hard to do. The devices have different aspect ratios and the difference in size between say iPhone 5 and iPad Air is pretty big to use one image for all. If you want to use the classical launch screen with a screenshot, resizing one image won't look the same as the user interface on different devices. If you want a launch bitmap image you will need to supply all the necessary sizes.
Whats the correct way of doing this?
You can create either launch PNG image or launch screen as a storyboard.
For launch image, your project has an assets catalog. Either use existing or add new iOS launch image. The editor will show you all required sizes.
For a storyboard, your application probably already has LaunchScreen.storyboard. You typically won't create specific size or sizes here, but use auto layout that will resize the screen appropriately.

How to let Xcode know which asset to use for the target iPhone?

I am designing an app for iOS in SWIFT. I have decided that the auto layout will be compact and will be only for iPhone in portrait mode. I wanted to clear up a few hiccups on designing buttons for the 2 different screen ratios: the first being the iPhone 4s and the second ratio being the iPhone 5 and above. Because the new iPhones have a taller height, does that mean I will need to design 2 different ratios of buttons, and if so, how do I use them in Xcode? For example here's the stock apple calculator;
link to picture: http://imgur.com/mkIBghD
As you can see the the buttons on the taller iPhone have a square shape. The buttons on the 4s are more stubby. What do I need to do in Xcode to let the app know which asset to use for the respective phone and how would I implement that in Auto Layout?
thanks
In order to do this you setup autolayout constraints. This will make the buttons change shape/size depending on the device. You do not need to have multiple assets because all the phones you are talking about have the same retina (2x) display.
You need to add three different sized images for a single Image Set in Images.xcassets . The sizes should be 1x for iPhone 4s, 2x for iPhone 6(It'll work for iPhone 5 too) and 3x for iPhone 6 plus.

Is it possible to define a custom image suffix for iPhone 6 Plus, while still using the same points sizes as on iPhone 5?

We have an app that is made for iPhone 4/5 and iPad/iPad Retina. The interface XIB files for iPhone do not use dynamic layout, and the code that places UI elements assumes a screen width of 320 points and a screen height of 480 or 568 (iPhone 5) points.
Due to a lack of time, we currently can't adapt the app for iPhone 6 and iPhone 6 Plus the "right way" (by changing the XIB files to use dynamic layout, and changing the code to work with variable screen widths/heights, then testing all the UI positioning again). But we easily can generate higher-resolution versions of the images.
I've experimented with the following: I don't add a Launch Image for iPhone 6 / 6 Plus; as a result, the app simply runs upscaled on an iPhone 6 Plus, and the screen still has 320 x 568 points. Everything runs fine, but the graphics are very blurry.
However, if I load a higher-resolution image (e.g. 1242 x 2208 pixels for the background) and set an UI element to use this image, then the image is sharp. (I'm testing with the simulator; don't have an iPhone 6 Plus available; I hope the behaviour is the same on a device).
Instead of adding the above workaround for each image individually, what I want to do is: at the start of the app, check the model of the device, and in case of iPhone 6 Plus, tell the app to use a custom image suffix. This suffix should be used for all images, not only those that are loaded via code, but also the images that are specified in XIB files. Is this possible?
Don't complicate yourself. just like retina with suffix #2x, you have to add #3x for iPhone 6 Plus.

iphone app size smaller than screen

I'm developing an app and have come against a strange issue I can't find the answer for - when testing the app on an iPhone 5 the whole app display window is shrunk down to what looks like a 3.5 size display (the top and bottom of the screen are black and even the status bar is pushed down). When I test the app on an iPhone 5s running iOS 8 it displays full screen as expected.
Also when testing in the iOS simulator for iphone 5, and 5s it displays as expected. I'm using xcode 6 for development.
Any help would be greatly appreciated.
You need to set splash screen for your app. Otherwise it will take 3.5 screen size.
Just set the splash screen and you will be done.
So from iOS8, you can use a .xib as your Launch image, but if you have to support past versions of iOS, you have to provide static SplashScreens.
here is a link about replacing the launch image with a .xib file
If you have to use static Launch images, you have to add every supported resolutions:
320 x 480 - not retina iPhones
640 x 960 - retina 3.5" iPhones
640 x 1136 - retina 4" iPhones
750 x 1334 - iPhone 6
1242 x 2208 - iPhone 6 Plus
use size class approach on any height and any width. Hope you will get your solution from the following link
http://captechconsulting.com/blog/tyler-tillage/ios-8-tutorial-series-auto-sizing-table-cells
just clarify on the other answers, make sure you also set the 'Launch Image Source' under 'General' -> 'App Icon and Launch Images'
screen shots....
...mine used to be....
...and i changed it to... (and set an image)
GLHF!

How to deal with iphone 6 size?

I launched my app on iphone 6 and 6 plus simulator. iPhone 6 plus uses #x3 images, but this have the same ratio. However, the iPhone 6 have a screen of 1334 x 750 (667 x 375) ... this sucks!
As you probably know, the app screen automatically fit to those new screen. But for the iPhone 6, images are bigger but they cannot be replaced (#3x is only for iphone6+).
How to deal with this new size?
I have to use autolayout only?
How to set the right screen size without automatically rescale this screen?
As Roger answered, you need to add the iPhone 6 and 6+ launch image
But you don't need to use autolayout. AutoLayout is one way of adapting to different screen resolutions, but the old autoresizingmask (springs and struts) is perfectly fine for most layouts. I use a combination of both as they each have pros & cons.
You need to do a couple of things:
Add a launch image for iPhone 6 and 6 plus.
adopt autolayout.

Resources