Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Universal layout vs different iphone/ipad storyboards

Is it okay to use different storyboards for different screensizes? I just can't make my png and icons images work for one storyboard as universal, it's a pain!

What about universal iPhone and universal for iPad? What's the best way?

Thanks

like image 876
masaldana2 Avatar asked Dec 21 '16 22:12

masaldana2


People also ask

How do I make different layouts for iPad and iPhone?

1) You can use Autolayout constraints and size classes to make the view compatible to both iPhone and iPad screen sizes. 2) You can create and use separate Storyboards or . Xibs each for iPhone and iPad and use accordingly.

What is adaptive layout in iOS?

Now apps can adapt their UI to a particular device and device orientation. This leads to a new UI design concept known as Adaptive Layout. Starting from Xcode 7, the development tool allows developers to build an app UI that adapts to all different devices, screen sizes and orientation using Interface Builder.

How do I use multiple storyboards in Xcode?

On the main storyboard, drag and drop a Storyboard Reference from the object library into the storyboard, then Ctrl + click a button on the main controller -> drag it to the Storyboard Reference -> Select Show. Now we just created a segue between two storyboards.

What is a storyboard Apple?

A storyboard is a visual representation of the user interface of an iOS application, showing screens of content and the connections between those screens.


2 Answers

You can also use one storyboard and set layout and font according to your requirements.

1) To set up layout properly for both iPhone and iPad, you need to use Aspect Ratio. You can check the answer in detail following these two links:

1) What constraints should be given to increase size of imageview with respect to device screen size without reducing image clarity

2) Calculating Aspect Ratio for all sizes of iphone - It will work for both iPhone and iPad.


2) To set different font size for iPhone and iPad, there is a setting in your storyboard, check the image.

there is the + symbol near your Label. For iPad, you need to set Regular height and regular width. And for iPhone it will take regular font size. (AnyHeight , AnyWidth).

Check the screenshots for better understanding.

enter image description here

enter image description here

Output :-

enter image description here

As a conclusion, you don't need to take different storyboards for iPhone and iPad. I hope this answer will help you.

like image 83
Badal Shah Avatar answered Sep 29 '22 04:09

Badal Shah


Although you can use multiple storyboards for multiple screens it usually isn't necessary if the layout is similar enough. Note at the bottom of the attributes inspector in the interface builder there is a box called installed. You can use this to specify what constraints go where. Add the ones you want to the devices you want and remove them from the others.

like image 41
Andrew McKinley Avatar answered Sep 29 '22 03:09

Andrew McKinley