I have a view with a UIProgressView control that I placed via storyboard and that I want to reposition to just under the status bar when the view loads, and whenever the orientation flips from portrait to landscape and vice versa. I've tried resetting its position in viewDidLayoutSubviews and orientationChanged, but when it first appears before the orientation changes it appears in the storyboard set location. Essentially I want the control to be hidden when the view first appears and only appear in the position I programmatically set when some action takes place and disappear when the task initiated by the action finishes. Seems like the position I'm initially setting is not being used when the control is unhidden. Rather the position where it is placed in the story board is where it first appears and I don't want that. Any ideas?
Asked
Active
Viewed 462 times
0
-
I'm guessing that you're programmatically setting the frame of the progress view, and that won't work if you're using auto layout. You need to position it with constraints instead. – rdelmar Mar 19 '15 at 05:45
-
I'm positioning it exactly at the bottom center of the navigation bar. I don't if I can do that with constraints. – bhartsb Mar 19 '15 at 23:41
-
It's a subview of the navigation bar? – rdelmar Mar 19 '15 at 23:45
-
No, just positioning it below it. – bhartsb Mar 20 '15 at 08:23