Hello.
I have a UIToolbar which I set programmatically to my UIView. I have added two UIBarButtonItems to the UIToolbar, with a user specified image and text.
My application responds to orientation changes via -
Code:
(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {...}
in this method I change the height of the UIToolbar (so it is shorter than in portrait mode) :
Code:
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
if (currentOrientation == UIDeviceOrientationLandscapeLeft || currentOrientation == UIDeviceOrientationLandscapeRight)
{
[self.myUIToolBar setFrame:barLandscapeRect];
}
}
The UIToolbar changes dimensions properly, but the UIBarButtonItem's in it don't scale too good. instead of being like this (thi sis a screenshot of portrait mode:)
Picture 3.png
it looks like this in landscape:
Picture 4.png
The original (portrait) height of the UIToolbar is 47 pixels. Through trial and error I have found out, that the UIBarButtonItems don't get squooshed unless they are less than 44 pixels.
This also happens with system ui buttons, like UIBarButtonSystemItemDone.
Any ideas why this is happening?
thanks,
Benny