iOS 8 UIPageViewController Applying Constraints After Transitions

前端 未结 5 1859
傲寒
傲寒 2020-11-28 03:05

My app has a multi-pane tutorial-style view that users swipe through to learn about the app. This is implemented very much as described in this tutorial. Having implemented

5条回答
  •  渐次进展
    2020-11-28 03:39

    I've been struggling with this for a few days.

    I tried to implement it by instantiating the page ViewController from the storyboard. There was a definite resizing occurring. Checking the frame size in

    1. pageViewController:viewControllerAfterViewController
    2. pageViewController:willTransitionToViewControllers
    3. pageViewController:didFinishAnimating:previousViewControllers

    The frame size would always change between the calls to 1 and 3. Sometimes before 2 and sometimes after.

    If you're also using storyboards, I was able to resolve the issue by extracting the page UI elements into its own XIB file, setting the constraints in IB and then creating the pages with a call to initWithNibName.

    Not a complete answer but it returned me to feeling productive. Hope it helps.

提交回复
热议问题