Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 8: Vary for traits changing layout for all size classes

I am trying to use the very for traits feature on xcode 8.2.1 but when I change the layout of one size class using the 'vary for traits' and then 'done varying' when finished it is in fact changing the layout of every size class in my storyboard.

e.g. I try to change the constraints on an ipad w: R, h: R by selecting vary for traits, turning the bar blue at the bottom. I make the necessary changes and click 'done varying' which changes the constraints. But then if I choose another device size such as iphone 7 then the adjusted constraints are also applied to this size class. How do I stop this from happening?

To clarify I have 'Use trait variations' & 'Use Autolayout' selected in the storyboard.

like image 557
Ryan.H Avatar asked Jan 11 '17 18:01

Ryan.H


1 Answers

When you start varying for traits, the new UI elements you add are only added to the current trait collection (w: R, h:R in your case). But if you're changing existing elements, they will change for all variations, unless you specifically add a custom configuration (see screenshots).

enter image description here

like image 172
silicon_valley Avatar answered Oct 11 '22 19:10

silicon_valley