【发布时间】:2023-10-03 06:04:01
【问题描述】:
我正在使用函数将只需要 2 个视图的应用程序将 shouldAutorotateToInterfaceOrientation 纵向视图更新为横向视图。 该项目正在使用 UINavigationController,因此如果我希望将旋转工作从纵向到横向,我必须使用以下代码实现所有类(总共 16 个):
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return YES;
}
所以现在轮换正在工作,但仅适用于所有视图!如果我只将此代码放在我需要的类上根本不起作用。
我怎样才能让旋转只对两个视图起作用?
【问题讨论】:
-
xcode 没有设备方向——它只是一个 IDE。
标签: cocoa-touch uiinterfaceorientation