当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - How do you get a UIPageViewController to work when rotated to landscape?

问题描述:

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?

网友答案:

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.

网友答案:

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.

网友答案:

Try following settings. It may help you.

分享给朋友:
您可能感兴趣的文章:
随机阅读: