iPhone 中横向模式下的 openUrl

发布于 2024-08-07 23:33:52 字数 322 浏览 6 评论 0原文

我正在尝试在横向模式下通过 Safari 打开网址。但还是没能做到。 以下是代码。

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.abc.com"] ]; [[UIApplication shareApplication]setStatusBarOrientation:UIInterfaceOrientationLandscapeRight 动画:YES];

提前致谢

I am trying to open the url through safari in landscape mode. But still not able to do it.
Following is the code.

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.abc.com"]];
[[UIApplication sharedApplication]setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:YES];

Thanks in advance

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

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

发布评论

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

评论(1

流殇 2024-08-14 23:33:52

横向模式取决于设备方向。 Mobile Safari 是第三方(实际上是 Apple 的),您无法在非您开发的应用程序中以编程方式设置横向模式。事实上,即使您在应用程序上设置了方向,一旦 Mobile Safari 启动,该设置就很多了。

Landscape mode depends on the device orientation. Mobile Safari is a third party (actually Apple's) and you cannot set landscape mode programmatically in an application you did not developed. In fact, even if you set the orientation on your application, as soon as Mobile Safari is launched that setting is lot.

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