Why does the UIPageViewController resize views of the UIViewControllers after page rotation?

Inside the viewViewController: viewControllerAfterViewController: method, before the return statement, the view to be returned as the next page has the correct frame size.

As soon as immediately after viewing the View Messages: didFinishAnimating: previousViewControllers: transitionCompleted: method is called, I check the frame size of the newly introduced view controller ([pageViewController2.viewControllers objectAtIndex: 0];) and I find it changed.

Notice that I set [self.pageViewController.view setAutoresizesSubviews: NO] and the autoresist mask to None for the newly created ViewController.

Any ideas at what stage the new ViewController is changing?

+3
source share
1 answer

I think the problem is related to the nature of the UIPageViewController. It is built from UIScrollView. I don’t know exactly why weird resizing occurs, but it is especially noticeable when the view controllers that make up your pages use auto-layout. Apparently, blocking the restrictions in your pageview dispatchers on the supervisor forces the elements to resize after the transition, because the supervisor itself gets resized after the specified transition.

, Apple . - , , , UIPageViewController. , - , .

, .

1.) " " " ". , "Constrain To Margins", , .

2.) /, , / - , . UIImageView, ( AutoLayout), , .

3.) . . , UIPageViewController, . , AutoLayout. , , UIPageViewController Autolayout .

http://www.appcoda.com/uipageviewcontroller-storyboard-tutorial/

+4

All Articles