I am developing universal app for iOS,
I am using Autolayout feature in my app,
I have one doubt:
I want to apply background image in my app,
How many background image i will have to make ??
and what will be the naming conventions of the images ?
so that iPhone automatically takes corresponding images according to device.
Like we gives on launch images, default#2x.png, Default-568h#2x.png, Default-Portrait#2x.png and device automatically understands it's corresponding images.
you need 2 types of images for iphone and ipad.
For ipad you just need to add ~ipad before .png. e.g. image.png for iphone and image~ipad.png for ipad.
Do the same for Retina display images also.
e.g.
iPhone Retina: image#2x.png
iPad Retina: image#2x~ipad.png
What should help in your case is Asset Catalogs, which are by far the best way to manage assets for multiple devices.
Related
I have created iPhone app with a lot of images as interface details. After completion, i decided that i also want to support iPad. So in size classes i chosen REG REG and edited constraints for new device.
Now I have a problem. All images in iPad mode are distorted. Absolutely all. I test on iPad 2 and physical iPad mini. For example I have a png with text
here it is on iPhone 6+
here of iPad2
as you see on iPhone it is smooth, but on iPad pixellizated.
And that happens to all images
Why can this happen ?
As the resolution of both, iPad and iPhone differ from each other, and you are comparing an image of iPhone6+ with iPad, so iPhone6+ will take #3x image while your iPad mini and iPad 2 will take the images of size #2x(if they are retina). So to support the image for iPad you have to add the images for iPad in your images.xcassets folder if your are using the xcassets like this
To get the options for images you have to select your xcassets folder then from the attribute inspector you have to check iPad.
I want to know the icon sizes for iPhone and iPad.
How can i support different screen densities in iOS.
In my app icon are blur in iPad and iPhone5.
App Icon Sizes for iphone and ipad:
iOS 5 and 6 - 57pts at 1x and 2x:(57x57,114x114)
iOS 7 and 8 - 60 pts at 2x and 3x:(120x120,180x180)
iPad - 76pts at 1x and 2x:(76x76,152x152)
You can read apple documentation to get better understanding.
You have to make your images suit the resolution
Check this LINK
You may want to take a look at this:
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html#//apple_ref/doc/uid/TP40006556-CH27-SW1
Basically: for all included images you should provide two files, 1 named ie "picture.png" and the other "picture#2x.png" and iOS which to use for itself.
You may get different icon sizes at following link :
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html
Set Project icon images as #1x,#2x and #3x, it will automatically get images as per iOS device resolution.
I have developed an universal app and i import my graphics stuff. I came across with the following thought. If the icon that is referred to iPhone retina display and the file that is referred to iPad non retina display has the same size, is there any way not to import the same file with different names (icon#2x.png & icon~ipad.png) twice?
I am not sure if there is such an icon size that would have same size for iPhone retina and iPad non retina device(Pardon me if I am incorrect). If you are talking about any normal image that you want same for iPhone retina and iPad non retina, and you want the app to automatically select the same image for both devices mentioned above then, no. You can manually do that though, which you probably already know.
What all splash screen images do we required to create an iOS application? I want to give support all the devices which supports iOS8. Trying to find out working of Images.xcassates and how to add splash images.
I want to support iPhone 4, iPhone 5/5s/5c, iPhone 6/6+, iPad.
What is the naming convention required to set LaunchImage? I just saw 1x, 2x, Retina 4 2x, and 3x in xcassates. But not getting what file names it required.
Like for non retina and and retina we simply twice non retina image for retina and name it like xxx#2x.png for retina and xxx.png for non retina.
Not getting apple document regarding this.
Thank you.
Now in New versions Image name for splash is not required. you can just drag and drop images in "LaunchImage" image asset. Please check below screenshot.
On right side you can see it's required image size in Expected Size : 1242x2208 pixels.
just drag same size image there and you are done.
Maybe this will help you.
There is a default black LaunchImage in xcassets, you jsut have to dragndrop your images into corresponding canvas. XCode will automatically name those images for you.
Note that in xcassets you can choose to see canvas for only iOS 8, iOS 7 or more, iOS 6 or more, etc.
Using image.xcassets, you do not need to follow naming convention. You just drag and drop the image to placeholder inside the image.xcassets. Xcode will handle that for you.
To support multiple device, you can easily match with the naming below the placeholder.
eg.
iPhone Portrait iOS7,8: 2x: iPhone4, Retina 4: iPhone5/5s/5c
For iPhone 6/6+, you can enable iOS8.0 iPhone checkbox on the right panel.
You can also see the expected sizing on the right panel.
I tried my iPhone app (potrait mode) on iPad Mini just for a test... I noticed that when I tap 2x Mode the text in UILabel, UITextview appears pixelated.
In case of Images I have an option of setting images for both 1x & 2x mode (img1.png & img1#2x.png), but how to do this for text?
I don't want to create images with text for UILabel.
As your app is for iPhone and you are trying to run this in iPad, it is showing like that. If you want it not to be pixeleted, you need iPad version of your app. #2x images are not to make your app compatible with iPad devices but for retina version of same devices.
Hinata is correct. you need to have a sparate iPad App for your Application so that it can run on iPad in full resolution mode. Go through the apple developer documents to know more about how to cerate iPad Application.
By default if you use universal as the build creator while creating your project the App will be supported on ipad's but they will run in 1X or 2X mode.
Let em know if you need more assistance on this.
Regards
Rajeev