Support for multiple iPhone resolutions with a single storyboard

We will all be updating our apps to iphone 6 and iphone 6 plus. This means that we need to support 4 sizes.

1.) 3.5
2.) 4
3.) 4.7
4.) 5.5

Can we support all of these screen sizes with a single xib or storyboard? Also share your views on how we can update existing apps for iphone 6 and iphone 6 plus.

+5
source share
2 answers

Yes. See Apple iOS8 documentation , in particular, size classes:

iOS 8 makes working with screen size and orientation more versatile. It’s easier than ever to create a single interface for your application that works well on iPad and iPhone, adjusting orientation changes and different screen sizes if necessary. Build applications with a common interface, and then customize them for different classes. Adapt your user interface to the strengths of each form factor. You no longer need to create a specific iPad layout; instead, assign appropriate size classes and customize your interface for a better experience.

In iOS 8, there are two types of size classes: regular and compact. The usual size class means either a large amount of screen space, for example, on an iPad, or a generally accepted paradigm that creates the illusion of a large amount of screen space, such as scrolling on an iPhone. Each device is determined by the size class, both vertically and horizontally.

There is also a very good instructional video on the WWDC website .

To stop scaling your iPhone 6/6 +, add a launch image of the desired size or better, use the storyboard to launch.

From there, you should use AutoLayout and avoid hard coding for screen sizes. Ultimately, it will be much less effort and less mistakes.

+7
source

In existing projects, you can use the automatic or automatic linking of xib files that support all 4 devices.

I am implementing my projects using automation to support all devices.

0
source

Source: https://habr.com/ru/post/1202755/


All Articles