2010-12-23 90 views
0

我有一个非常奇怪的事情,在我的一个应用程序中使用UIWebView,但当设备被旋转到横向模式时,UIWebView内容无法正确加载。UIwebview内容加载不正确

我可以看到UIWebView大小是正确的,但内容不知何故悬而未决。

对于这种情况,我在iTouch中查看了safari,但是对于他们来说,它的工作非常好。

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

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

干杯,

马诺

+0

您能否进一步描述问题究竟是什么?同一网站是否正确加载和旋转MobileSafari?或者该问题是否也存在? – Pascal 2010-12-23 14:56:18

+0

嗨帕斯卡尔,也许我可以再次给你一个清晰的问题图片,它就像你在Uiwebview上打开一个页面(例如ebay.in)并放大和缩小然后旋转到横向模式,出现这个问题的原因是UIwebview的内容(意味着页面)没有以适当的大小加载。 – 2010-12-27 11:48:28

回答

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 

}