0

我正在使用标签栏控制器在拆分视图上创建应用程序。我的问题是当我在肖像上并隐藏主视图时,我的表单会消失。如果显示了当前的表单,有没有办法防止轮换?

4

1 回答 1

0

在您的代码中包含此方法,如果您的表单被关闭,您可能需要添加一个附加方法。这段代码会将您的视图锁定为横向。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations.

if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
    return YES;
} else {
    return NO;
}

}

于 2013-05-17T16:57:31.137 回答