0

I am a new learner for IOS , and I am programming in my Xcode14.2.According to my IOS book, I need to choose transverse mode and click 'vary as traits' button.But I did not see anything above.Is there anything I missed? My Xcode panel

ge1mina023
  • 155
  • 1
  • 13
  • It seems to have gone missing in Xcode 13. You can select a constraint and then click on the little "+" button next to the value that you want to vary and add a variation for that value – Paulw11 Feb 12 '23 at 08:31
  • @Paulw11 Because I do not understand the function of 'vary as traits', I am stuck on this Xcode change. What does this feature mean? – ge1mina023 Feb 12 '23 at 10:45
  • Different device sizes have different traits in different orientations. In portrait orientation an iPhone would be regular height and compact width. In landscape it is compact height and regular width. You might want different constraint values depending on the device size and orientation. Varying the constraint values based on the traits lets your interface adapt to device sizes and orientation without hardcoding specific tests for device screen sizes. – Paulw11 Feb 12 '23 at 19:56
  • @Paulw11 It seems to add one variation for my Constraints that already exist. What should I do if I want to add other Constraints to make my element show up another place in my landscape? – ge1mina023 Feb 22 '23 at 13:41
  • Add the constraint and then use the + button to select the trait variation you want it to show for and then deselect the "any,any" variation – Paulw11 Feb 22 '23 at 19:53

0 Answers0