IOS 8 Adaptive Layout. Different Layout for ipad orientation - ios

Can some one please give me some idea of how to use universal storyboard to show different layouts for iPad portrait and landscape.

Not possible at the moment. I have filed a bug report as wanting a new feature to be added to make it possible. I'll keep you updated.

Related

Supporting all iphone sizes

I'm trying to create a iOS app, but I'm stuck on the layout.
I created the home view, but now I see that it's not shown in the right way in the 4S simulator.
I tried with size classes, but it looks like 4S and 6, for example, are in the same size class, and so I can't set a different dimension for views.
My goal is to support all devices, also iPads. Can someone please tell me how to do it?
Size classes mostly used for separation between ipad, apple watch and landscape modes.In potrait mode iphone 4 to iphone 6 all phone device sizes are in same class(regular height and compact width).Autolayout has many different constraints to help you to fit interfaces in same class.You should consider horizontaly/verticaly align, equal width and aspect ratio constraints.They are so flexible for smaller size changes and help you to design adaptive layout.
You should use "Reset to Suggested Constraints" for all views in your View controller. You can also check the simulated metrics for all devices without compiling the the code.
For 4s and 6 by default the size is Inferred. You should try resetting the constraints to check this for iPad as well.
I am just sharing an idea
Option1:
I think You can try adaptive Layouts and in file inspector->simulated Metrics->size-> Inferred. It works in all devices it supports both landscape and Portrait.
Option2: Go for Visual layouts they are easy to understand and they work perfect in all modes of Portrait.
I am think that you use code Instead design in main.storyboard !
for ex: create button with code
(and use Ratio in your code)
by this way i create small app for iPhone & iPad
!

Required to implement Autolayout Constraint and SizeClasses?

I have an iPhone app which should support for iOS 7 to iOS 9(Enhancement) and all the screen sizes as well. Storyboards are enabled Use AutoLayout and Use Size Classes properties. I am not much familiar with using auto layout.
Do I need to add constraints for views to support all the screen sizes? Is there any other ways to achieve that? Launch Images and Icons are enough for all the screen resolutions? will make any problem when iTunes submission?
Yes to it is recommended to run application on all iphone as well as ipad using a single design , use these tutorials it would help
1.) https://developer.apple.com/library/ios/recipes/xcode_help-IB_adaptive_sizes/chapters/EnablingAdaptiveSizeDesign.html
2.) http://code.tutsplus.com/tutorials/an-introduction-to-adaptive-design--cms-22888

Appropriate way to manage different views for portrait and landscape?

I'm developing an app targeting iOS 7 and above. I'm using storyboard and autolayout, and I have to show different layouts of each storyboard scene depending on the device orientation, I mean, for example: in portrait I may have a button at a certain place that has to be shown in another place in landscape, or I may have controls in portrait that should disappear in landscape and have to rearrange the rest of controls.
My question is: when there are a lot of differences between portrait and landscape, should it be better to manage all this changes by programmatically updating constraints, or should it be better to create different nib files and load the corresponding according to the orientation?
use size classes their will be no problem in giving support to ios7 . I have tested their were no major problems in ios7 while using size classes.

Do I still need two Storyboard files to manage different devices now with Universal Storyboards?

I have an iPad only app that I'm switching to support iPhone as well. Not going well so far, the project was created before universal storyboards. When I run it on the iPhone, it sticks with the good ol' iPad size. Should I delete my storyboard and add a Universal one, or create separate Xib's / Storyboard's to support iPhone's?
I don't think you need to create separate xib or storyboard to support iPhone.
You can enable auto layout and size classes in your storyboard. Auto layout helps you layout your views based on constraints while size classes helps you check whether the view is running in iPad or iPhone, as well as the device orientation.
You can then layout your screens based on different size classes.
Please check WWDC video Building Adaptive Apps with UIKit for more information.
You can use a second storyboard but in my opinion it is easier to generate all the objects in code. Then you can use values like this: self.view.frame.size.width/2 to center it on the x-axis on every device. And you don't need a storyboard for every screen size.

iOS 8 auto layout? Do I need it?

Is there a way to have an app work on all tall iPhone devices (portrait mode) without using Auto Layout?
Can I just design for say iPhone 5 and have iPhone 6 and iPhone 6 plus stretch to fill.
Auto layout seems overkill when I don't need to design for landscape or iPad.
Any ideas?
Auto layout seems overkill when I don't need to design for landscape
or iPad.
That's definitely not true. You could argue it was true before the launch of the iPhone 6, but even with only iPhones 4 and 5 it helps to account for different situations.
Can I just design for say iPhone 5 and have iPhone 6 and iPhone 6 plus
stretch to fill.
Stretch to fill is something that you can easily achieve with AutoLayout.
I know it seems a bit tough at first, but it's actually based on really simple mechanisms and behaves very logically. It's definetely worth giving it a try, you'll get much more out of it than you might expect right not.
Although Auto layout is optional, but to me it is a recommended feature.
Once your design become complex, you would have to write a lot of code to support different screen sizes. This can be avoided by using auto-layouts.
Yes you can in Show the size inspector-> Autoresizing. But you have to do it for each subview for each .xib file or in storyboard

Resources