views:

324

answers:

2

I have had many successes programming the iPhone in Landscape mode, but I have been unable to get the Apple PageControl demo to run in Landscape mode and render the content correctly. The demo uses the AppDelegate class as an implicit ViewController which manages a UIScrollView, and the AppDelegate creates a set of UIViewControllers for the ScrollView's contents, 1 controller per page. In addition there is a UIPageControl object that the AppDelegate manages.

I can get the demo code to run in Landscape mode, but the contents always render as if they were in portrait mode, so while the simulator displays he device in Landscape mode, the pageControl is always on the side of the screen.

If anyone has gotten the contents to rotate correctly, I would really appreciate an explanation of how you got it to work.

A: 

I am having exactly the same problem ! Has anyone solved this problem? Or did you find your answer anyhow Andy? I would really appreciate if you could share.

VolDem
I haven't been able to solve this, and I even went so far as to post the same question on the Apple iPhone forums, which also produced no answers. If I do manage to solve this I'll post an entry giving details.
Andy Glick
A: 

I think it doesn't work because the scrollview is attached to window, and the window doesn't have a autorotate method like a view, it seems. If you put the scrollview in a view and then that view in the window, and the views controller has the shouldAutorotateToInterfaceOrientation method defined, it works. However, there is still a bit more work to do as the bounds of the pages are now wrong and need to be reset.

Gary