UIwebview内容未正确加载

时间:2010-12-23 13:11:21

标签: iphone ipad uiwebview

我有一个非常奇怪的事情,我在其中一个应用中使用了UIWebView,但是当设备被轮换到横向模式时,UIWebView内容无法正常加载。

我可以看到UIWebView大小合适,但内容却以某种方式悬空。

对于这个案例,我检查了iTouch中的safari,但对于它们来说它的工作非常好。

我不知道问题在哪里。我在简短的搜索后发布它,但也无法得到任何帮助。

如果你们有任何人知道如何解决这个问题,那将非常有帮助。

干杯,

的Manoj

1 个答案:

答案 0 :(得分:0)

如果您的应用程序支持全部4方向,则在info.plist中为支持的接口方向创建一个键。

<key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
   // Return YES for supported orientations
   return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration 
{
   //Also you can use this method

}