【发布时间】:2013-05-18 00:57:31
【问题描述】:
我正在使用标签栏控制器在拆分视图上创建应用程序。我的问题是当我在肖像上并隐藏主视图时,我的表单会消失。如果显示当前的表单,有没有办法防止轮换?
【问题讨论】:
我正在使用标签栏控制器在拆分视图上创建应用程序。我的问题是当我在肖像上并隐藏主视图时,我的表单会消失。如果显示当前的表单,有没有办法防止轮换?
【问题讨论】:
在您的代码中包含此方法,如果您的表单被关闭,您可能需要添加一个附加方法。这段代码会将您的视图锁定为横向。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations.
if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
return YES;
} else {
return NO;
}
}
【讨论】: