我有一个简单的UIWebView嵌套在ViewController中,它以模态方式从导航控制器中呈现。此导向代码为什么不起作用?
结构如下:TableViewController - > TableViewController - >模态(的WebView呈现) - >模态(选项,通过手势而呈现,页面卷曲)
所有视图处理所有的方向,除了一个与它的WebView,它是通过配置来处理它的方向。
与Web视图控制器具有以下方向代码:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
BOOL orientationSwitch = NO;
if([self.webApp.orientationLandscape boolValue] &&
UIInterfaceOrientationIsLandscape(interfaceOrientation))
orientationSwitch = YES;
if([self.webApp.orientationPortrait boolValue] &&
UIInterfaceOrientationIsPortrait(interfaceOrientation))
orientationSwitch = YES;
return orientationSwitch;
}
现在的意图是,你可以设置一些选项,这就是如果认为应作出反应的方向变化。大多数情况下,它可以工作,但是我有一个模式弹出窗口,您可以选择关闭包含Web视图的模式。一旦发生这种情况,整个应用程序的方向似乎都被锁定了。所有其他意见随后不会对任何形式的轮换作出响应。
任何想法?
谢谢
什么是orientationLandscape?它是字典的关键吗? – CodaFi 2012-02-26 05:32:12
这些都是包裹在NSNumber中的布尔值。来自核心数据。 – Slappy 2012-02-26 21:13:37