I’m working on this iPad app and I’m thinking of using auto layout to make my life easier. I created this side bar control that allows users to change to a different page (just like the tab bar controller, but this is along the left side of the iPad). Now in landscape orientation I want the width of this view to be 256 px but when the iPad is in Portrait orientation I want this view to have a width of 100 px. How can I use auto layout to pin the width of the view depending on the interface orientation?
Share
You can use the updateViewConstraints call to modify the layout on orientation change.
The example below creates a view programatically but you could wire up the width constraint of you side bar in interface builder to achieve the same thing.
For example: