I'm adding a couple of pictures to my project for a slideshow which runs static in the background. But I have the feeling that I don't name the images accordingly.
I support iOS 6 - iOS 7 therefore (if I knot getting this wrong) I have to create 3 variants for the three different screen sizes I have to deal with.
default.png (iPhone 3Gs)
default#2x.png (iPhone 4 / 4s)
Those two work great but I'm struggling with name for the iPhone 5 (4 inch).
I tried default-568h#2x.png and default#2x-568h.png.
Has anyone found a way to get this working? There are literally no examples/explanation in the docs.
Thanks in advance :)
If you are using Xcode 5 you can still use the asset-catalog to support iOS 6, you just need to drag the images on to thumbnail locations in the asset catalog, and then it doesn't matter what they are called.
If you are supporting down to iOS6, it even gives you placeholders for iOS6 specific images.
If you aren't using the Asset Catalog be sure to use the correct case for the image names which are:
Default-568h#2x.png
Default.png
Default#2x.png
The filesystem on the device is case sensitive, while the file system for the simulator is not, so you need to be sure to get the case correct.
Add the file for your splashscreen with the name you like :
Default.png
Default#2x.png
Default-568h#2x.png
And add the key Launch image in your info.plist`.
But, as suggested by #Abizem, with XCode 5 is easier to use the asset-catalog.
Related
Say I have an image which is half the height of an iPhone 4s screen display, when this image is loaded to an iPhone 5 clearly this size is no longer half the size of the iPhone, as the iPhone 5's height is slightly larger then the iPhone 4s.
My question is, like using the image 2x and 3x, is there a way of adding images to your app that target specific iPhones? So that the other images not targeted will not be downloaded with the app.
Or will I need to add images of various sizes to the app and then in the code, say if iphone4 load this image, if iphone5 load this? The only reason I don't want to do this is because I will have 3x the amount of stored images (target iPhone 4, 5, 6) than I would for the iphone6 plus or iPad.
What I was hoping for something like image#2x~iphone4.png or image#2x~iphone5.png, but this doesn't work.
David Cao's answer is correct for bundled image assets, but you have mentioned that you don't really want to include this many assets with the app.
You may want to look at the App Thinning features of Xcode 7 / iOS 9, along with On-demand Resources this will allow you to load your required images into Xcode but the App Store would only download the resources required for the device being used.
If you still need to support iOS 8 you would need to have the images stored on a remote server and load them in when needed.
Take a look at image assets, it solves the exact problem you've stated.
https://developer.apple.com/library/ios/recipes/xcode_help-image_catalog-1.0/Recipe.html
What it does is allows you to provide 1x, 2x, and 3x images which can be referenced as a single name, when you call [UIImage imageNamed:#"imageNameHere"].
I had imported all 3 Launch Images First
1: 320 x 480
2: 640 x 960 (Retina 3.5-inch)
3: 640 x 1136 (Retina 4-inch)
they have the following default names that are needed:
1:Default.png
2:Default#2x.png
3:Default-568h#2x.png
and Get the rejection with the warning :
iPhone 5 Optimization Requirement - Your binary is not optimized for
iPhone 5. As of May 1, all new iPhone apps and app updates submitted
must support the 4-inch display on iPhone 5. All apps must include a
launch image with the -568h size modifier immediately following the
"basename" portion of the launch image's filename. Launch images must
be PNG files and located at the top-level of your bundle, or provided
within each .lproj folder if you localize your launch images. Learn
more about iPhone 5 support and app launch images by reviewing the iOS
Human Interface Guidelines and iOS App Programming Guide.
Even after adding:
Default-568h.png of size 320 x 568
then also get the rejection with the same Warning
Where is the problem in launch image NAME or in SIZE
Well I have faced the same issue and found the solution by adding the default-568h#2x.png file at the root level As show in the image
And make sure you don't use image asserts for launch image, This solved my problem.
The way you named the large app icon is correct "Default-568h#2x.png". If you are using any background image for your app, make sure the image exists for iPhone 5.
I guess you are trying to support older versions of iPhone like 3G. Apple stopped supporting older versions of iPhone.
To overcome this issue what you are facing, all you have to do is compile with latest SDK. Keep armv7 architecture in Project build settings. And keep deployment target >= 4.3 SDK.
This is the fix for your issue.
For those who are using AIR:
(v3.9 at least)
Air automatically generates the icons folder with this default structure and names:
project/icons
│
├── android
│ ├── icons
│ └── ...
│
└── ios
├── icons
├── Default.png
├── Default#2x.png // Should be rename to Default-568h#2x.png
├── Default-Landscape.png
└── Default-Portrait.png
To solve this problem, Default#2x.png should be rename to Default-568h#2x.png.
I couldn upload my binary unitly I clicked "Use Asset Catalog" and migrated launch images & icons.
After that I got this screen and clicked array:
At the end I had to drag/drop launch images from my resource folders into blank squares:
After this I was finally able to publish our app.
Are you sure the 568h file is actually in PNG format? Also make sure that you provided support for iphone 5 for all your screens? Only adding Default-568h#2x.png is not gaurantee for iphone 5 support. You have to check for framing of all your view for iphone 3.5" and 4" device.
You can do the framing by code or autoresizing that is other thing.
Did you see how it iPhone 5 screen(on a device or simulator)? Try this
Name - Default-568h#2x.png
Size - 640 X 1136
I had the same problem today and finally got it solved!
The problem originates from a localized -568h#2x Launch image.
Normally localization works well, but apparently Apple did a major screw-up with their iPhone5 optimization validation script and it isn't localization aware.
So what I did to fix it is copy any Default-568h#2x.png from one of the .lproj folders next to the lproj folders and add it to the target you are trying to compile/submit. This most likely will increase your package file by one unnecessary launch image (although compression should probably get rid of it) and will "trick" the validation script to rightfully accept your app binary.
I get this if I am building with iOS 6 support enabled. By default it isn't enabled in Media.xcassets/LaunchImage as you can see by the unchecked box under iOS 6.0 in the attached screen grab (grey bit).
So tick that then you will see the empty slots appear as per the screenshot on the right above'iPhone Portrait 5,6'.
Now go back into your Xcode source directory and into the Launchimage.launchimage directory and drag the Dafault.png, Default#2x.png and Default-568h#2x.png images to the relevant boxes.
QED - it fixes that iTunesConnect upload issue for me every time.
Can you please check proper format of your image? It should be in .png format. Because, name which you gave for default image is correct..So, please image format.
There can be many reasons of Rejections , beside the launch images.
Read out the warning properly and check all the things mentioned in the warning.
Check the following link for further changes Apple has given for Application Uploading after 1st May.
May 1 deadline for app changes
For iPhone 5 the image size will be 640 x 1136 pixels(#2x). Try this it will help you.
As of May 1 every app needs to fully support iPhone 5. not only launch Screen but all the UI aspects of your app needs to be fully compatible with iPhone 5.
If you localized launch images, you have to put launch images in every .lproj folder even if this .lproj folder was not added directly by you.
I encountered this problem. I am using appirater which provides many localizations (many .lproj folders are added into the target). However I only localized launch images for several languages I need. So my app was rejected because there were no launch images in some .lproj folders. The solution is simple. Removed unnecessary localizations or localize launch images for all languages.
There are detailed steps to resolve this issue caused by appirater on my blog. http://vinceyuan.blogspot.hk/2013/08/a-weird-reason-why-ios-app-is-rejected.html
Got the solution:
Your iOS Deployment Target should be 4.3 or later
Xcode should be version 4.5 or later
I've created an application for iPhone with icon versions for retina and no-retina display (icon#2x.png and icon.png).
Whenever I try to install this application on an iPad 3 a part of Default#2x.png is used instead of icon#2x.png.
Have i to upload specific icon for iPad ? and in this case where!? from Xcode 4.3.2 I see only 2 spaces to include icons, but reserved for iPhone version. I suppose that i need to create a new voice into plist file... but I'm not sure and documentation didn't help me.
I ran into the same problem. I created the resource files Icon-72.png and Icon-72#2x.png in the root of the bundle and added them to "Icon files" in the Info page of the target (Info.plist). Strangely, this didn't do the trick.
My final solution was to convert the target temporarily into an universal app, drag the iPad icons into the corresponding slots of the target's summary page and build it. After that, revert the target to an iPhone/iPod touch app, clean it, built it again.
Interestingly, this seems to work.
Old question, but with Xcode 6.3, if you use assets catalogs, select AppIcon, tick iPad (for iOS 7 and up) and add your 76x76 and 152x152 icons to the catalog
I would create 2 more icons called
icon~ipad.png
icon#2x~ipad.png
The first one will allow for iPad 1/2, and the second one will allow for Retina iPads (iPad 3).
Adding those 2 icons may be enough. Also, try a Clean & Rebuild as Luke said.
Hope this helps =)
I think you should use Icon-72. i used that
When determining the appropriate App-Icon the OS searches the "best fitting size" Icon in the CFBundleIconFiles array or the CFBundleIcons in the Info.plist. If the Default(#2x).png is in one of those arrays, it is selected for best fitting on iPad Retina. Solutions:
Eliminate the Default(#2x).png from this arrays. For the Launch image there is another property. If you do that, the iPhone Retina Icon will be selected.
Optionally add the iPad resolution Icons (72, 72 / 144, 144) to one of those arrays. Then the OS will determine one of those as best fitting.
For the Info.plist keys see also:
https://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/App-RelatedResources/App-RelatedResources.html#//apple_ref/doc/uid/TP40007072-CH6-SW1
Consider, that the naming of those Icon files are only relevant for older iOS versions. In new versions, the OS just searches for sizes in the mentioned arrays.
Considering that the iPhone 4 has a much higher screen resolution than iPhone 3 -
How can I port my code to iPhone 4.
Won't recompiling it change the appearance of images, controls, etc.?
The provided UI elements should take care of the scaling for you. For anything you render, you'll need to take into account the screen resolution and scale accordingly. You might want to look at :
http://developer.apple.com/library/ios/#documentation/2DDrawing/Conceptual/DrawingPrintingiOS/SupportingHiResScreens/SupportingHiResScreens.html%23//apple_ref/doc/uid/TP40010156-CH15-SW1
I'm sure you already know this, but just in case you don't: you should be sure to include larger assets in your XCode project with #2x before their file extensions. For example: icon#2x.png. #2x tells iOS to use the larger version of the asset for Retina and iPad displays.
I am planning an app for iphone 3g, 3gs and iphone 4. I have a 57*57 image for 3g and 3gs. When I checked documentation apple suggests us to use a 114*114 image for iphone 4. So how can I support both the images with the same build.
Use the CFBundleIconFiles property in your Info.plist and supply two icons, you name the high-resolution one with an "#2x" suffix so the iOS knows it's the high-resolution icon to use on iPhone 4. You can also specify iPad icons (for apps that run on iPhone and iPad) using the same property. This is documented here: http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BuildTimeConfiguration/BuildTimeConfiguration.html
Call the iPhone 4 icon Icon#2x.png
http://developer.apple.com/library/ios/#qa/qa2010/qa1686.html
You have to list all your icons in your Application's plist, and name the ones for iPhone 4 "Name#2x.ext" (add '#2x' to your file's name).
If you place the original icon and an icon with the same name but add #2x to the end of the name in your resources folder the correct one will be used automaticly.
The collection of different possible icon sizes for iOS is getting pretty long now. But all you need to do is to list all of the files in your app's Info.plist in the CFBundleIconFiles key, and the OS will do the work of picking the correct size.