I have have a View containing:
- a
MKMapView
, to display some items on a map - an
UITableView
embedded in aUIView
, to display the items in a list
The user must be able to display the map or the list, by moving a separator.
This works well, but I encounter an issue after the user rotates the screen: in this case, the list is no longer correctly displayed.
The list's position UIView
is setted by specifying it's top margin constraint: the first time I know the status bar height (with UIApplication.SharedApplication.StatusBarFrame.Height
).
But after the rotation, I need to recalculate this constraint. For this, I try to recalculate the constraints in ViewWillTransitionToSize()
.
My problem is that I don't get the expected value during the call to ViewWillTransitionToSize()
: the "old" value of StatusBarFrame.Height
is setted.
I also try to get the statusbar status
with UIApplication.SharedApplication.StatusBarHidden
but the problem is the same.
Is there another way allowing me to get the correct statusbar height during the rotation?
I've tested the statusbar status at the wrong place:
If the test is dont correctly, this works fine.