Re: UIPageViewController not resizing its child view controllers on rotation
Re: UIPageViewController not resizing its child view controllers on rotation
- Subject: Re: UIPageViewController not resizing its child view controllers on rotation
- From: Ben Kennedy <email@hidden>
- Date: Tue, 30 Jun 2015 20:05:40 -0700
> On 30 Jun 2015, at 7:30 am, Devarshi Kulshreshtha <email@hidden> wrote:
>
> Though pagination control has resized properly, view of added view
> controller has not resized properly.
You haven't said so, but I presume that the UIPageControl belongs to your root view, and not pagesContainerViewController's view?
If so, the evidence suggests that autolayout is working correctly for the former but not the latter. And presuming that is the case, then my suspicion lies with this line:
> self.view.translatesAutoresizingMaskIntoConstraints = NO;
It is unusual to specify translatesAutoresizingMaskIntoConstraints on oneself, since it is almost always one's parent who is responsible for one's positioning. And absent any other constraints, this will remove its autoresizing with respect to its superview.
Hence, my guess is that the pagesContainerViewController's view has no constraints, and thus is getting unspecified layout (as manifest by its child UIPageViewController's view positioning).
What happens if you delete that line?
b
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden