What is wrong with size classes?
Asked Answered
P

2

1

I have created a new project. And set a UILabel into two position depending on size classes, but wCompact, hAny can not trigger in iPhone simulator. I have set label x position to 0, but it is still on 15px as on wAny, hAny. Why? Use Size Classes is set. I am using Xcode beta 3.

enter image description here enter image description here

Pointillism answered 29/7, 2014 at 6:45 Comment(5)
Who the hell know what Apple did with Size classes :/ sorry m8!Elliot
So not I am the only one who is struggling with size classes under beta Xcode?Frasier
I think that u r the only one that struggle with this, others just avoid that :), same as auto layout.. Just kidding man!Elliot
Did you add a constrained to keep it at 0 px from the left?Pickaxe
I forget set constrains, thanksFrasier
P
0

I forget to set constrains. Set size-classes have nothing to do with view's position, to position views needs only to set up constrains.

Pointillism answered 29/7, 2014 at 13:42 Comment(2)
That's nothing to do with size classes. That's the same for AutoLayout for the past 2 years :) (I didn't down vote BTW)Lieselotteliestal
I could set different positions by selecting different size classes, and I thought positions will be dependent also from orientations, but now I know not, only if constrains are used tooFrasier
P
0

You have missed to set the margin. I faced this issue in Xcode 6. Select constraints to margin. If you are designing for backward compatibility (that is for lower versions of iOS) the don't select constraints to margin. Just set the constraints manually by giving position values.

Polytechnic answered 30/1, 2015 at 11:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.