zoukankan      html  css  js  c++  java
  • 单个ViewController支持横屏,其他全竖屏方法-b

    如果项目中用了navigationViewController, 那么就应该新建一个uinavigationViewController的子类,然后在这个类里面写上下面的代码,在使用的时候就用自定义的这个navCtr, 就是说需要在根视图里面控制

    1. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation 
    2. return toInterfaceOrientation != UIDeviceOrientationPortraitUpsideDown; 
    3.  
    4. - (BOOL)shouldAutorotate 
    5. if ([self.topViewController isKindOfClass:[AddMovieViewController class]]) { // 如果是这个 vc 则支持自动旋转 
    6. return YES; 
    7. return NO; 
    8.  
    9. - (NSUInteger)supportedInterfaceOrientations 
    10. return UIInterfaceOrientationMaskAllButUpsideDown; 
  • 相关阅读:
    7、python数据类型之集合set
    python基本数据类型练习
    matplotlib
    numpy常用函数
    pillow包
    keras-tensorflow版本对应
    python-激活和切换运行环境
    端口监控
    numpy
    低风险创业笔记
  • 原文地址:https://www.cnblogs.com/isItOk/p/5610599.html
Copyright © 2011-2022 走看看