【发布时间】:2012-10-18 06:23:10
【问题描述】:
我正在创建具有 4 个选项卡的 Tabbar 应用程序,我的 FirstTabView 应该支持所有方向,所有 3 个 tabView 应该只支持纵向,当我将选项卡更改为 SecondTabView 时,它应该强制将方向更改为纵向,这在情节提要中是否可行我将以下代码用于 FirstTabView.m
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return(interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
在 SecondTabView.m 中
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return(interfaceOrientation == UIInterfaceOrientationPortrait);
}
它不允许任何选项卡视图支持横向提前感谢。
【问题讨论】: