问题
I am using a UIPageViewController
in my app.
It works quite well, but when I turn pages, the next page seems to get initialized in a frame that is bigger than the screen: While turning the page, only a part of the view of the next viewController
fits on the screen.
I am initializing the UIPageViewController
in viewDidLoad
and started to log the frames of the PageVC
, its subviews and the parentVC
. Every frame seems to be okay, only the UIPageViewController'
s frame, which I log in viewControllerAfterViewController
has a width that is nearly the double of the screen's actual size.
回答1:
I finally solved this issue by setting the right frame to the UIPageViewController
's view when initializing the PageVC:
pageViewController.view.frame = self.view.frame;
Where pageViewController
is the UIPageViewController
I initialize,
and self is the parent VC of the pageVC.
Hope this helps anyone with similar problems.
来源:https://stackoverflow.com/questions/12998322/uipageviewcontroller-has-strange-size