I have a custom UIView which has a dedicated, manually set frame for portrait and landscape orientation because autoresizingMasks just don't work in my case.
I set this frame in:
- (void)viewWillAppear:(BOOL)animated
And it works as expected.
My problem is now, that my UIView furthermore has subviews that also have a dedicated position for portrait/landscape.
I position these subviews in:
- (void)layoutSubviews
If I now leave my viewController in e.g. portrait orientation, rotate to landscape on another viewController and then come back to this viewController I see that my view got resized correctly, but the subviews of my view, which get positioned in layoutSubviews are not repositioned yet but are resized in an animated fashion after the view already appeared.
I do nothing in viewDidAppear and I already tried calling
- (void)layoutIfNeeded
As well as:
- (void)setNeedsLayout
In viewWillAppear
, but it doesn't seem to change anything.
Any ideas what I'm doing wrong?