Is there anyway to have the UIBarMetrics of a custom UIToolbar change when the device is rotated? I would prefer it happen automatically but if there is something I can do during rotation that would also be ok. I would like to use UIAppearance so manually adjusting the height of the bar won't work.
Asked
Active
Viewed 1,877 times
1 Answers
0
I think you need
UIToolbar *toolbar = [UIToolbar appearance];
[toolbar setBackgroundImage:[UIImage imageNamed:@"toolbarLandscapePhone"] forToolbarPosition:UIToolbarPositionBottom barMetrics:UIBarMetricsLandscapePhone];
You can simple to setBarMetrics to UIBarMetricsLandscapePhone
-
Yes, I am setting the background image for UIBarMetricsLandscapePhone but the bar is not changing when I rotate it. It only changes if I use the toolbar from a UINavigationController. The UINavigationController must be doing something with the UIBarMetrics that is not happening automatically with a stand-alone toolbar. – drewag Jan 27 '13 at 06:01