iPhone 中横向模式下的 openUrl
我正在尝试在横向模式下通过 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
横向模式取决于设备方向。 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.