设置横屏与竖屏的方法

找到RootViewController.m这个文件,打开

找到这个方法

// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// return YES for the supported orientations
// Only landscape  仅支持横向
// return ( UIInterfaceOrientationIsLandscape( interfaceOrientation ) );
// Only portrait    仅支持竖向
// return ( ! UIInterfaceOrientationIsLandscape( interfaceOrientation ) );
// All orientations  既支持竖向又支持横向
// return YES;
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-01
相关资源
相似解决方案