views:

336

answers:

2

Hello

I thought I had already asked this question but I cant see it so I will ask again.

I need to write an app which simply contains a webview that rotates. How do I rotate the text when the user puts their phone from portrait to landscape or vice versa?

Cheers

Paul

A: 

Are you controlling the UIWebView with a UIViewController? If so, override

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
kubi
A: 

This is handled automatically. In your view controller, override the method:

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation {
    return YES;
}

And make sure your webview's autoresizing mask is set like this:

webView.autoResizingMask = UIViewAutoresizingFlexibleHeight |   UIViewAutoresizingFlexibleWidth;
Ben Scheirman
HelloThanks for your help are there examples for how to use the autoresizing dialog? It confuses me!Not sure how to " make sure your webview's autoresizing mask is set to FlexibleWidth | FlexibleHeight"CheersPaul
Rupert