1

ModalView的打开和关闭有问题:当用户触摸按钮打开视图或触摸按钮关闭它时,在控制台中出现以下消息:UITabBarController和模态视图的自动旋转问题

视图控制器从_shouldAutorotateToInterfaceOrientation返回NO:用于所有接口方向。它应该至少支持一种方向。

ModalView与UITableViewController相关联,UITableViewController包含在UINavigationController中,并依次插入到UITabBarController中。我无法理解如何解决这个问题。

回答

1

嗯,这是现在很老了,但以防万一它可以帮助别人:你的代码可能是这样的:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 
    return NO; 
} 

的问题还有就是你基本上是说,你的观点不会支持任何定向:)

它应该是这个样子:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 
    // Support portrait only 
    return (toInterfaceOrientation == UIInterfaceOrientationPortrait); 
} 

微不足道,但也许这可以帮助别人的未来。