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

血红的双手。 提交于 2020-07-18 05:27:46

问题


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.


回答1:


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).



来源:https://stackoverflow.com/questions/41598165/xcode-8-vary-for-traits-changing-layout-for-all-size-classes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!