Weizhi
Weizhi

Reputation: 172

Orientation change but view's frame doesn't work correctly in iOS

I have a custom container view controller(red background color). Front view controller added as child view controller. Container view controller supports UIInterfaceOrientationMaskPortrait, child view controller supports all orientations. When rotate the simulator , views do not position correctly.

Here is the view hierarchy.

enter image description here

Upvotes: 0

Views: 70

Answers (1)

Weizhi
Weizhi

Reputation: 172

I solved the problem by setting child controller view's autoresizingMask to UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight.

Upvotes: 1

Related Questions