我正在使用函数将只需要 2 个视图的应用程序将 shouldAutorotateToInterfaceOrientation 肖像更新为横向视图。该项目正在使用 UINavigationController 因此,如果我希望将旋转工作为纵向到横向,我必须使用以下代码实现所有类(总共 16 个):
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return YES;
}
所以现在轮换正在工作,但仅适用于所有视图!如果我将此代码仅放在我需要的类上根本不起作用。
我怎样才能让旋转只对两个视图起作用?