I’m using a UINavigationController to manage my UIViewControllers hierarchy. For one of these UIViewController, i need to change its view bounds programmatically (depending on specific conditions) so i used setBounds and it’s working fine.
My issue is this : when i change this view bounds, then push another UIViewController to the UINavigationController stack and then pop the last UIViewController, my bounds changement are lost. I guess it’s because my UIView is redrawn but i thought the bounds modification would still be live.
I can change my UIView bounds again after the view appeared but the user will notice the view bounds modification.
Any tips? Is it a common situation or is it because my UIView is loaded from a XIB and i missed a parameter or something?
Thanks 🙂
Edit : just noticed my UIView bounds are changed right before pushing the new UIViewController to the stack (during the animation)
You probably want to do all of your bounds-setting (including the first time) in
-viewWillAppear:. This should get called before you’re put on screen in both the initial push and the pop case.