UITabBarController refusing to rotate

I was struggling for some hours on an issue with an App I’m writing for the iPhone.

For some reason I could not get any of the views to rotate to landscape, the API docs suggested that this was trivial and only required implementing the method

(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

and always returning YES

The problem is that this doesn’t work if you are using a TabBarController created in Interface Builder. You can verify this by create a new project, specifying the type as “Tab Bar Application” and rotating the simulator…

I found a quick and easy solution to this problem in the following blog post

Change iPhone/iPod app orientation within a UITabBarController

I added maybe a dozen lines of code to my app and the problem is solved….

Thanks Arash…

Short URL for this post: http://bit.ly/92mmxL

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>