All my old apps are looking good on iPhone6/6+. But when I create new project iPhone 6/6+ treat apps natively. So they look awful. Instead of trying to adjust views using constraints and stuff, I decided it would be better to write app for iPhone 5 and let new iPhones scale it. I know solution is not perfect but is good enought for me. The questions is how to make new iPhones treat my app as iPhone 5 app. How to make them scale it?
Thank you.
You have to provide a LaunchImage with the correct size :
iPhone 6 Splash screen 750 x 1334
iPhone 6 Plus landscape Splash screen 2208 x 1242
iPhone 6 Plus portrait Splash screen 1242 x 2208
I'm answering this by memory as I don't have xcode in front of me, but I'm quite sure it's correct.
You need to create and add 3 launch images to your project of the following sizes:
*640x1136
*640x960
*320x480
Go to project settings, general and select the launch image source option. Select use asset catalog, and create an asset catalog if you don't already have one.
With the asset catalog open you should have a section called launch images, if you do not, tap the '+' button in the bottom left hand corner and add the launch images option to your project. Select the launch images option.
The top row of images are used for iPhone 6/6 Plus, leave these blank. Drag and drop the launch images that you created onto the bottom two rows of images.
Return to your project settings and select the launch screen file option. Remove everything - ensure that the selection is blank. (To do this I selected my main.storyboard and just deleted the text in the text box).
And that's it, now you can automatically zoom your app on the larger devices.
Hope this helps.
Related
I have a very old xcode/objective-c iOS project.
I tried to compile it on the lastest Xcode version and it works fine.
On big iPhones, the application is streched to fit in bigger screen.
I tried to create a new Xcode projet and drag all my source files in the new project. I removed storyboard.
It works, but the application is not stretched. I see 2 black bands at the top and the bottom of the screen.
What i want is just to understand which parameter i have to changed in the project.
This is not a storyboard or size classes issue because i have no storyboard or xib files. I tried to change iOS version déployment target.
Thanks
You need to add a launch image for the large screen size of the plus models or better a launch screen file.
See: here
Add launch images of of accurate sizes as follows for iOS 8 and later.
Goto launchScreen in the XCAssets, you can see these options on the right pane see the image attached.
and add images with size :-
Image type Size
Retina HD 5.5″ 1242 × 2208 pixels
Retina HD 4.7″ 750 × 1334 pixels
Originally I was used Xcode 5 (w/ iphone5) to create an app, and it worked good on Xcode 6 w/ iOS7/8, even on iPhone 6 and 6+, the app will automatically scale up to fit the new screen sizes. Recently I have migrated to Xcode 7 and found there is a black bars on top and bottom, so I follow the suggestions to include main.storyboard as launch screen file, but now the app will not be able to scale it up automatically. I found a discussion about this: Xcode 6 resizes app automatically for iPhone 6 and 6 plus
So I try to create an single view app from scratch (using Xcode 7), delete the Launch Screen File and Launch Image Sources, put something objects on the view, and then remove Auto Layout and Size Classes from main.storyboard, but the app does not expand to fill the new device size for 6+.
Is it possible to do so?
Simple way is Use xcassets, you need to Create a Launch Image Set and add all images with proper size
Create an assets file. File->Create->Resource->Assets Catalog
Select the file, and add New iOS Launch Image
Add an image for each size. Make sure that the resolution of the file has the same aspect ratio as the required file, but the resolution that you want your app to have. E.g. even though it expects 1242 x 2208 for iPhone 5.5, enter 640x1136, and your app will be scaled down to 320x568 with retina autoscaling
You can find out the expected resolution to determine the aspect ratio in the properties inspector at the bottom of the right tab.
Finally, go to your target's configuration under General->App Icons and Launch Images and set your launch image source to LaunchImage (or whatever you called the image).
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.
Without modifying any code in a new Xcode 6.0 Single View project targeting iPhones running iOS 7.1, the result on my testing iPod Touch 5th gen device shows a shifted version of what's in Interface Builder. It appears the shift is downward. I've already tried turning off Auto Layout and Size Classes, and resetting all UIView coordinates to (0,0), but still the battery symbol and upper bar is too far down! Please see pictures below for Interface Builder screenshot, and device screenshot. The question is how can I keep what I see in Interface Builder, and stop the iPod from shifting down the entire UIViewController? Thanks!
UPDATE: In the end, I had to go into project build settings, click on the app under Targets, and change Launch Images Sources to a new folder it titled "LaunchImage-2" and delete the Launch Screen File field, which was set to Launch Images.
If you don't add the Default-568h#2x.png
then xcode build the project of size 3.5 inch and shows black patch at the bottom.
So you have to compulsory add the image with name Default-568h#2x.png of size 640 x 1136
If you use an empty Asset Catalog for your Launch Images, the iPhone 5's screen size is supported (without having to include any image files at all).
It seems that you need to add the default or launch images into the project. Your project should be using image assets, so there you will see launch images and you need to supply images of appropriate sizes, preferably for all iPhone screen sizes.
I want my app to have a new icon for iPhone 6/iPhone 6 plus BUT I don't want to use the Asset Catalog and I still want the app to open in Zoom/Scale mode (I don't want to make any changes and for it to look good on the new iPhones).
What is the proper way to do that?
just put new icon files Icon-Small#3x.png (87x87), Icon-Small-40#3x.png (120x120), Icon-60#3x.png (180x180). To keep scaling, do NOT put new launch images for iphone 6/6 plus
Have you set a Launch Screen image / view?
If you're using Storyboards, try to add MainStoryboard to the Launch Screen, and make sure you've set the correct launch screens. Clean and build and see what happens.