Adaptive Layout in Xcode 8
Asked Answered
E

2

10

I am developing app using Xcode 8 (beta 1). Unfortunately, I am not able to find "Size Classes" option.

In Xcode 7, there was option "Use Size Classes".

enter image description here

But in Xcode 8 there is no such option. Is there any help for using Size Classes or similar in Xcode 8?

Educable answered 28/7, 2016 at 8:45 Comment(0)
P
10

Now you have "Use Trait Variations" which is improved version of Size Classes

enter image description here


You can now select device based and orientation based trait view much like size classes (iPad Pro, iPad, iPhone 6Splus, iPhone 6s, iPhone SE and iPhone 4s)

enter image description here

Prosecute answered 28/7, 2016 at 8:53 Comment(3)
How can I have common layout for all resolutions? w - Any h - AnyGlomma
Prior to Xcode 8, any needed to be explicit, and in some places you’ll find explicit uses of any still. Often Xcode 8 hides Any from you, making it implicit instead of explicit. This resource could be useful to you: makeapppie.com/2016/09/05/…Symphonious
So I have Use Auto Layout and Trait Variations checked, and my view controllers change size on IB, great. But I thought with Size Classes you could change the view in IB, do some work, then it would save those changes ONLY for that size?Buckjumper
C
6

Apple introduce new feature called Trait Variations.

Trait Variation

So now you can simply create how it looks on real device.

enter image description here

You can simply switch devices by just clicking and also change the orientation of your view.

Cowfish answered 28/7, 2016 at 8:57 Comment(5)
All iPhones in portrait at wC hR so how to make different layouts for 7+ and 4s sizes?Zebapda
The new layout video is uploaded by apple you can also assign some layout objects for only some devices.Cowfish
I see that video but that's when devices have different Traits. Sadly as all iPhones in portrait have same traits they cant be used to make adaptive layoutsZebapda
@DhruvKhatri How can I set different Vary traits for different iPad orientation?Aeschines
Check out this two videos this will guide you @TalZion Check out Making Apps Adaptive, Part 1 from #WWDC 2016 developer.apple.com/wwdc16/222 Part 2 from #WWDC 2016 developer.apple.com/wwdc16/233Cowfish

© 2022 - 2024 — McMap. All rights reserved.