I have a UIPageViewController with a simple UIViewController inside of it.
If the the UIViewController has no subviews, its view resizes correctly when rotated. (Solid green background).
If the the UIViewController has a subview with a fixed frame, its view resizes correctly when rotated. (Solid green background with yellow square in corner).
If the the UIViewController has a subview with its auto layout constraints set to fill its superview, its view no longer resizes correctly when rotated. (Solid yellow background with the UIPageViewController's red background visible). The auto layout code I use is:
UIView *v = [[UIView alloc] init];
[v setTranslatesAutoresizingMaskIntoConstraints:NO];
[v setBackgroundColor:[UIColor yellowColor]];
[[self view] addSubview:v];
NSDictionary *viewsDictionary = NSDictionaryOfVariableBindings(v);
NSArray *cs = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|[v]|" options:0 metrics:nil views:viewsDictionary];
[[self view] addConstraints:cs];
cs = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|[v]|" options:0 metrics:nil views:viewsDictionary];
[[self view] addConstraints:cs];
Why would the auto layout of a subview affect its superview? This only happens if it is contained within a UIPageViewController.