Reputation: 625
I add a view in storyboard using autolayout. I set the constraints on the view so there is no problem for the view with autorotation.
Now, I add a subview to the view programmingly instead of using stroyboard. The autorotation doesn't work now. The subview always show as portrait, the same thing as you don't set constraints on a view in storyboard. I set the autoresizingMask = ~UIViewAutoresizingNone; but it doesn't work since this is for old style of sprint and struct.
Is there an easy way to do to make autorotation work for a view programmingly adds to a view which is using storyboard? Thanks.
Upvotes: 0
Views: 122
Reputation: 4586
translatesAutoresizingMaskIntoConstraints = NO;
to your's programmaticaly created view.Upvotes: 1