UIWebView 不随多个选项卡应用程序旋转
我正在使用 UIWebView 在 iPhone 上显示 PDF 和 Word 文档。我希望它们在设备方向改变时自动旋转。为此,我添加了以下委托方法。但有些奇怪的事情正在发生。当我只有一个包含 UIWebView 的选项卡时,它工作得很好。它可以很好地加载文档并且也可以完美旋转,但是当我添加另一个选项卡时,它不会旋转..!在调试时,我可以看到当我有两个表时,它仅接收 UIDeviceOrientationLandscapeRight 和 UIDeviceOrientationLandscapeLeft 的旋转事件。任何人都可以帮我摆脱这个问题吗?
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 返回是;
}
谢谢。
I am using UIWebView to display the PDF and Word documents on iPhone. I want them to auto rotate when device orientation changes. For that I have added following delegate method. Something weird is happening though. It works fine when I have I have only one tab which has UIWebView. It loads document fine and also rotate perfectly but when I add another tab, it doesn't rotate..! While debugging I could see that when I have two table, it receives the rotation event only for UIDeviceOrientationLandscapeRight and UIDeviceOrientationLandscapeLeft. Could any one please help me to get rid of this.
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return YES;
}
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您对选项卡使用选项卡栏控制器,则需要确保所有选项卡上的视图都支持不同的设备方向。尝试实现选项卡栏控制器类中的方法。
Assuming you're using a tab bar controller for the tabs, you need to make sure that the views on all tabs support the different device orientations. Try implementing the methods in the tab bar controller class.