• Home
    • Home – Layout 1
    • Home – Layout 2
    • Home – Layout 3
  • News
  • Technology
  • Gadget
  • Design
No Result
View All Result
  • Home
    • Home – Layout 1
    • Home – Layout 2
    • Home – Layout 3
  • News
  • Technology
  • Gadget
  • Design
No Result
View All Result
Tutorial
No Result
View All Result

iOS Guide to Multiple Device Resolutions

December 9, 2020
in Uncategorized
0 0
0
iOS Guide to Multiple Device Resolutions
0
SHARES
2
VIEWS
Share on FacebookShare on Twitter

With every iOS updates and new release of devices from Apple, there are more things developers have to do.

In order to support these new devices, you first need to understand these devices.

Device Resolutions

Apple provides a table matrix on the App Icons, Screen size, and tool bar icon sizes for the various devices.

This table summarizes the resolutions:

iPhone 5 iPhone (Retina) iPhone iPad (Retina) iPad
Actual 640 x 1136 640 x 960 320 x 480 1536 x 2048 768 x 1024
Default.png 640 x 1136 640 x 960 320 x 480 1536 x 2008 768 x 1004
App Icon 114 x 114 114 x 114 57 x 57 144 x 144 72 x 72
Toolbar icon 40 x 40 40 x 40 20 x 20 40 x 40 20 x 20

Note that for iPads, the Default.png should not include the status bar (20px).

Image Resource File

Apple introduced an easy way to load images automatically for the devices.

The rule goes like this:

  • Standard: <ImageName><device_modifier>.<filename_extension>
  • High resolution: <ImageName>@2x<device_modifier>.<filename_extension>

For example,

  • MyImage.png – Default version of an image resource.
  • MyImage@2x.png – High-resolution version of an image resource for devices with Retina displays.
  • MyImage~iphone.png – Version of an image for iPhone and iPod touch.
  • MyImage@2x~iphone.png – High-resolution version of an image for iPhone and iPod touch devices with Retina displays.
  • MyImage~ipad.png – Version of an image for iPad
  • MyImage@2x~ipad.png – High-resolution version of an image for iPad with Retina displays.

With that knowledge, you could load a UIImage

UIImage *anImage = [UIImage imageNamed:@"MyImage"];

and the appropriate resource file will be loaded.

iPhone 5 – taller screen

Unfortunately, for the taller iPhone 5, it does not automatically load MyImage@2x~iphone5.png.

You could use a handy UIImage category to load.

Previous Post

Common Git Usage

Next Post

Wifi Scanner for Mac OSX (Mountain Lion)

Next Post
Wifi Scanner for Mac OSX (Mountain Lion)

Wifi Scanner for Mac OSX (Mountain Lion)

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Home
  • News
  • Technology
  • Gadget
  • Design

© 2020 AwlNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
    • Home – Layout 1
    • Home – Layout 2
    • Home – Layout 3
  • News
  • Technology
  • Gadget
  • Design

© 2020 AwlNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Create New Account!

Fill the forms below to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In