The #2x image is not loaded on iPad retina - ios

i've been writing an app for iPad. I used 2 images, menuBar.png and menuBar#2x.png, on for normal and the other for retina. When i run on simulator, it's perfect. But when i built and run on iPad 3, it seems doesn't load the retina image.
Can anyone give me a solution or show me where i go wrong?

The image should be called:
iPhone non-retina: menuBar.png
iPhone retina: menuBar#2x.png
iPad non-retina: menuBar~ipad.png
iPad retina: menuBar#2x~ipad.png
if not named liked this, it will fall back to the iPhone non-retina image

Related

Swift - Images Distortion in universal app

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.

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 set the same image for iPhone Retina Display and iPad non Retina

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.

AssetCatalog LaunchImage Landscape only - iPhone 4S/5/5S not shown

For a Sprite Kit Game i am providing my LaunchImages through an AssetCatalog.
The catalog looks like this:
The image is shown correctly on:
all iPads
iPhone 6
iPhone 6 Plus
The image is not shown on:
iPhone 4S
iPhone 5
iPhone 5S
I am developing for a minimum target iOS 8
Can you figure out what is going wrong? As you can see i even added the portraits for the iPhone to see if anything is loaded as launchimage - but nada..
Did you try to select the iOS8.0 and later box for iPhone Portrait?
Solved it by going the old proven way:
Provide all the above assets for apps in landscape only
Dont use AssetCatalog

Retina iPad Simulator display issue?

I'm making a retina iPad app. When I test with iPad simulator I get a nice display of my icons and buttons etc...
But when I switch to the retina simulator I get big buttons and images... Is that normal? Unfortunately I haven't a real iPad to test on.
Yes it is normal.
The reason being is the resolution of the retina display is 2048x1536 while the regular iPad is 1024x768.
When you test your app in the regular simulator, you'll see your app in 1024x768, which will appear "regular sized" on your display. When you test your app in the retina simulator, you'll be seeing your app in the full 2048x1536 resolution. And since chances are very good your computer monitor is not a retina display, you'll see it a bigger window with scaled up UI elements.
If you test your app on an iPad with a retina display you'll see everything is the same size as on a non retina iPad, since the physical screen size is the same.

Resources