So far my application only handles landscape orientation, and now I want it to also handle portrait orientation. Almost all the views should end up having very different layouts depending on the orientation, so I thought first of creating another Storyboard and assign it each of them to a specific orientation. But from everything I read from here, it looks like it’s not the right thing to do.
Here is the layout I want to have:
So I tried to use Size Classes instead, but I’m very confused about how it works. For example, I tried this from this existing layout:
final class TestCell: UITableViewCell {
@IBOutlet weak var headerLabel: UILabel!
@IBOutlet weak var subtextLabel: UILabel!
}
Changing the orientation, clicking “Vary for traits” based on width, and updating the layout with "Done Varying",
But now when I want to save this, and come back to landscape mode, I end up having the same layout for both orientations:
So what am I doing wrong? Thanks for your help!
Try using Vary for Traits again...
wC hR
firstwC hC
Height
(width is still wC
)That should give you what you want.