2010-01-12 56 views
0

我以为我已经问过这个问题,但我不能看到它,所以我会再问。有没有围绕Webview的例子?

我需要编写一个简单包含一个可以旋转的webview的应用程序。当用户将手机从纵向放到横向或反之时,如何旋转文字?

干杯

保罗

回答

0

你控制与一个UIViewController的一个UIWebView?如果是,覆盖

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
1

这是自动处理的。在您的视图控制器,覆盖的方法:

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

,并确保您的WebView自动尺寸调整掩码设置是这样的:

webView.autoResizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; 
+0

您好 感谢您的帮助在那里为如何使用自动尺寸实例对话? 它让我困惑! 不确定如何“确保您的webview的自动调整掩码设置为FlexibleWidth | FlexibleHeight” Cheers Paul – Rupert 2010-01-14 12:04:47