views:

358

answers:

1

Hello,

In my app, when a user selects a cell from a UITableView, I create a UIView programatically, add it to the window object, then create an UIWebView and a UIButton and add them as subviews to that view I created.

myView = programatically created view

webView = the UIWebView that is a subview of myView

button = the UIButton that is a subview of myView and is just a "Close" button displayed on top of the WebView

The question is how do I make that programatically created view autorotate when the user rotates his/her phone to landscape (of course, the webview should also autorotate so the user can read the webpage better)?

Thank you!

A: 

Your programmatically created view should rotate with everything else. Make sure you are returning YES in the method - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation in your view controller.

Nikolai Krill
I'm a noob, so I might ask stupid questions, but what is the view controller? Is it the class from where I create that additional view? Anyway, I have tried adding that method both to the class where the creation happens or to the app delegate and it still doesn't work.
Marian Busoi