UIwebview 内容未正确加载

发布于 2024-10-08 16:06:18 字数 311 浏览 0 评论 0原文

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

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

对于这种情况,我在 iTouch 中检查了 safari,但对于他们来说它工作得很好。

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

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

干杯,

马诺吉

I got a pretty weird thing, am using UIWebView in one of my apps, but while the device is being rotated to landscape mode, the UIWebView content is not loading properly.

I can see the UIWebView size as proper but the content is somehow dangling.

For the case, I checked safari in iTouch, but for them its working pretty fine.

I dunno where is the issue. I am posting it after a brief search but could not get any help either.

If any you guys know how to fix this, it will be really helpful.

Cheers,

Manoj

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

や三分注定 2024-10-15 16:06:18

如果您的应用程序支持所有 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

}

If your application supports all 4 orientation then in info.plist create a key for Supported interface orientations.

<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

}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文