views:

180

answers:

1

Hi there, I am trying to do something I am not really sure is possible :)

I have application that is in portrait mode and doesn't react to device rotation. Almost all parts of app work best in portrait so I disabled autorotation. But one part should be viewed in landscape. I just drawed my view rotated by 90 degrees and with this forced user to rotate device (again no autorotation). Everything was ok until I added UITableViewController that is invoked from this (and only from this) rotated view. Table view is of course in portrait mode, so user has to rotate device again, which is not really user friendly experience. My problem is, how to manually rotate table view so it is in landscape mode without using autorotation feature. I was able to rotate it using transform, but I can't position it properly. Is this right way of doing this or did I missed something that would make this trivial task?

I don't want to use autorotation because both part are pretty separated from each other and each of them would be almost useless in other's mode

A: 

First thing I'd suggest is to try to find an alternative UI. If you can come up with a better way to do it, you may be able to not have to tackle this issue.

That said, you could use the UIDevice setOrientation (private API) just before you do your push of your new view.

@SanHolo provided me with an answer recently regarding setOrientation that might be an even better solution, but I haven't tried it yet -- you could try putting your table view controller in as a modal view. He implied that it would check the new tables rotation affinity and would automatically rotate when it came into being.

Epsilon Prime
Your app will be rejected if you use private API calls.
Alex Reynolds
I think they aren't enforcing this particular private API call. My application published two weeks ago was not rejected. To be more correct this is a private method on a public interface.
Epsilon Prime
Other developers have noted that their applications were rejected for using that specific call, e.g. http://www.drobnik.com/touch/2009/11/forbidden-fruit-apple-apis/
Alex Reynolds
thanks, I will give it a shot. Thinking about different UI was first thing I tried, but I was unable to come up with anything better
Lope