Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

LTX

macrumors regular
Original poster
Dec 25, 2008
164
0
Vancouver, BC, Canada
I have an iPad application with UIToolbars on the top and bottom, with UIBarButtonItems in them. I want the icons in the bar buttons to rotate with didRotateFromInterfaceOrientation:. I found a resource for rotating buttons using a CGAffineTransform and the transform property of a UIButton, but UIBarButtonItem does not have that property. Apple does it in the Camera app on iPhone, so I know it's possible in buttons, but maybe not in bar button items. I do not want the toolbars to move on device rotation.

Right now I'm in the process of trying it with a UIButton. How do I detect when the device orientation has changed without returning YES in shouldAutorotateToInterfaceOrientation:? If I have YES in there for other orientations, the toolbars move to landscape positions, but I am able to get the state change from didRotateFromInterfaceOrientation:. If I return NO, I don't get anything from didRotateFromInterfaceOrientation: because the user interface does not rotate.

Any help would be appreciated.

Thanks.
 
I managed to get it working with a UIButton, but I want it to look like the UIBarButtonItems I already have, with the gray tint from the toolbar. Is there any way to do this?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.