Child View Controller shifts down

前端 未结 2 1937
予麋鹿
予麋鹿 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.

提交回复
热议问题