Child View Controller shifts down

前端 未结 2 1922
予麋鹿
予麋鹿 2021-01-05 07:43

I have a TutorialsViewController that has a PageViewController added programmatically as:

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additi         


        
相关标签:
2条回答
  • 2021-01-05 08:20

    I seem to have found the fix for it, it was related to the auto layout constraints i had set up. My child view controller contains an image view that completely fills it. So i give following constraints to the image view:

    1. Center Horizontally In Container
    2. Center Vertically In Container
    3. Equal Widths (to the container view)
    4. Equal Heights (to the container view)

    This stops the view shifting/flickering problem.

    0 讨论(0)
  • 2021-01-05 08:23

    I've solved this problem with the help of this answer: iOS 8 UIPageViewController Applying Constraints After Transitions by replacing in PageViewController's child all constraints on top layout guide to view.

    0 讨论(0)
提交回复
热议问题