Reputation:
In this tutorial on UIPageViewController (there's a download for the project at the bottom) the author sets up a great UIPageViewController
that works flawlessly in portrait mode.
But it goes completely awry when rotating to landscape. The image is pushed to the bottom left corner, and in general it's just completely messed up.
I cannot figure out how on earth to solve this issue. I've searched and searched, and no example projects seem to work in landscape. What do I need to do in order to make it work in landscape?
Upvotes: 3
Views: 609
Reputation: 10323
PageContentViewController
in that tutorial has no layout constraints applied to its views.
For UIImageView
I set space to superview in each direction.
For UILabel
I set space to superview in each direction except bottom.
Now image is stretched.
Upvotes: 1
Reputation: 2352
I just implemented UIPageViewController in my most recent project so here's a snapshot of some of the properties I'm using to set it up correctly. Essentially, it's the placement of the spine location that is probably messing up your display. Try playing with the different values (i.e. None, Mid, Min, Max) and see what works for you.
Upvotes: 1