This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Running app built in iOS4 on iOS 3.0, why is everything huge?
My images in my app are all 2x (or more) the size that they appear at. But for some reason, some of these images are appearing at their original size on the screen, when testing on a device, and so appear twice as large as they do in Interface Builder and on the simulator. And some are appearing at the size they should be.
Any ideas why this could be? My iPod Touch is 1st generation, so it's on 3.0 software.
The app probably only includes double resolution images for the Retina Display, and they're not suffixed with "#2x" to indicate that they're double.
Related
This question already has answers here:
Image resolution for new iPhone 6 and 6+, #3x support added?
(4 answers)
Closed 8 years ago.
So I've just started using Xcode to make a game for iOS and I've been struggling with the whole screen size/background image sizes...
I've been reading a lot of questions like this, but I don't understand what is meant by #3 and #2 etc?
I was under the impression if I account for the size of iPhone 6+, it would all just be scaled down/autofit iPhone 6... or visa-versus.
If you plan to support for only iOS 8 and onwards on your game then you do not have to give different images for different device types.
As per the WWDC 2014 video titled "What's new in interface builder" Apple introduced support for Vector Images. You have to give the the image at 1x resolution and Xcode will create the required images at compile time. I found this link useful for further understanding.
http://martiancraft.com/blog/2014/09/vector-images-xcode6/
On the other hand if you want to support iOS 7 also then you will have to give 3 sets of images for #1x, #2x and #3x. These numbers are scaling factors. Apple introduced newer devices with higher resolution it became necessary to give higher resolution images to keep up with the device resolution. So these sets of images are basically to be be displayed on devices with different resolution.
#1x - non retina devces like iPhone 3GS. iPad,iPad2 (not a complete list)
#2x - iPhone 4s, iPhone 5,iPhone 5s,iPhone 6,iPad 4 (not a complete list)
#3x - iPhone 6+
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to develop or migrate apps for iPhone 5 screen resolution?
How to deal with iPhone 5 screen size?
With 5th generation devices in the market having bigger screen, we need to have a bigger launch image (image that is shown when app icon is tapped). How would app make the difference like when to use the normal image and when to use the bigger image based on the device type?
I see a warning in my project when I build it for iPhone 6.0 simulator tap on which throws the below alert:
You need to add a launch image named Default-568h#2x.png. The compiler checks for this image and validates it. If the image is validated, your app is ready for iPhone 5 - otherwise not. Once you have the right image, follow the steps outlined in this post:
How to develop or migrate apps for iPhone 5 screen resolution?
If you are having issues with the images being used INSIDE the app, and you want to support iPhone 5 and pre-iPhone 5 devices, use this:
Dealing with different size images in a xib for iPhone5 versus iPhone4?
For short: If you want to support iPhone 5 screen you must supply launch screen for the 4" screen otherwise your app would run on 3.5" on the 4" screen.
If you put the 4" launch image that one would be used on iPhone 5 and the 3.5" one on iPhone 4 (could be different).
Please see my detailed explanation here.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to detect iPhone 5 (widescreen devices)?
Do any adjustments need to be made for an app started in development prior to the iphone 5 in order for them to work on the iphone 5's larger screen?
If so, what are these changes, or where can I find what to change? google hasn't been too helpful so far.
Thanks
After adding the Default-568h#2x.png launch image, follow the steps outlined in this post:
How to develop or migrate apps for iPhone 5 screen resolution?
If you are having issues with the images being used INSIDE the app, and you want to support iPhone 5 and pre-iPhone 5 devices, use this:
Dealing with different size images in a xib for iPhone5 versus iPhone4?
You need to add a default launch images with 640x1136px named Default-568h#2x.png to support the iPhone 5 screen.
First, you have to have a 640x1136 launch image (with -568h#2x.png suffix) to make it compatible with the iPhone 5, but to fully make use of the larger screen, there are a many ways to do it. I find the easiest way to do it is to make two separate storyboards, making a new one for the iPhone 5, while maintaining the one you have already used for the iPhone 4S, 4, etc. Using two storyboards removes the necessity for AutoLayout; enabling AutoLayout, it is good to note, also removes iOS 5 compatibility. Use the code in this answer to get started.
Depending on how your app views are laid out, you may not need to make too many changes. If you have views that resize and are anchored correctly, such as scroll views or table views, they will expand to fill the additional space on the iPhone 5 screen. You need to add an additional launch image for the new screen size too.
the iphone 5's screen is taller so you'd need to have images with a resolution of 1136x640 also included in your images folder. (add -568h#2x at the end of image's filenames)
also, everytime you will adjust your sprites and everything else that goes on the screen, you will need to account for the iphone 5 separately, just like you account for the ipad and the iphone (non retina and retina).
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to deal with iPhone 5 screen size?
So with the release of iPhone 5 today and a larger screen height, how do we accommodate for different screen sizes across the different iPhone variants in our apps. I understand that apps which are not updated for iPhone 5 will be "letter boxed", but what about backwards compatibility?
Is there a way to check whether the app is running on an iPhone 3, 4 or 5?
You normally don't need that, because checking the hardware is not the right approach.
If you need to base decisions in your app on the screen size, like accomodate to the screen size for your UI, you should… test the screen size, not make some conditions on the hardware. Always test what is really necessary.
Use [UIScreen mainScreen].bounds for that (as you should always have done). Note that even before iPhone 5, one could plug its iPhone on a videoprojector or external screen and display its app on a screen with different resolution than the iPhone. That's why I hope that you never use magic numbers in your code (And if you did, you know why it's bad now ;)) and was already using constants or asking at runtime for the size of your screen.
Anyway, to accomodate for different screen sizes, if you configured your autoresizing mask correctly in your views, your applications will resize automagically. You just need to provide a Default-h568#2x.png launch image and your app will take the full size of the 4" screen.
Moreover, starting iOS6, you will be able to use AutoLayout to do finer constrainted layout of your views. See the WWDC'12 videos sessions that explains it in detail.
Checkout the UIDevice-Hardware extension, it was even recently updated to add support for the iPhone 5.
This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
How to accommodate for the iPhone 4 screen resolution?
What is the best way to include Retina Display Images on an iPhone app. Are there issues with the iPhone 3G or older iPhone with higher res images?
Include a hi-res version of your image named as "image#2x.png" (where "image.png" is the normal resolution). When you access your image using [UIImage imageNamed:#"image.png"], the correct one will be chosen automatically. Devices without retina display won't load the hi-res version, so there's no memory overhead.