作家
登录

代码处理iOS的横竖屏旋转

作者: 来源: 2017-07-25 13:05:41 阅读 我要评论

  •   
  •  
  •         case UIInterfaceOrientationUnknown: 
  •  
  •             NSLog(@"未知偏向"); 
  •  
  •             break; 
  •  
  •   
  •  
  •         case UIInterfaceOrientationPortrait: 
  •  
  •             NSLog(@"界面竖立"); 
  •  
  •             break; 
  •  
  •   
  •  
  •         case UIInterfaceOrientationPortraitUpsideDown: 
  •  
  •             NSLog(@"界面竖立,高低倒置"); 
  •  
  •             break; 
  •  
  •   
  •  
  •         case UIInterfaceOrientationLandscapeLeft: 
  •  
  •             NSLog(@"界面朝左"); 
  •  
  •             break; 
  •  
  •   
  •  
  •         case UIInterfaceOrientationLandscapeRight: 
  •  
  •             NSLog(@"界面朝右"); 
  •  
  •             break; 
  •  
  •   
  •  
  •         default
  •  
  •             break; 
  •  
  •     } 
  •  
  •  
  •   
  •  
  • //最后在dealloc中移除通知 
  •  
  • - (void)dealloc{ 
  •  
  •     //... 
  •  
  •     [[NSNotificationCenter defaultCenter]removeObserver:self]; 
  •  
  •     [[UIDevice currentDevice]endGeneratingDeviceOrientationNotifications]; 
  •  
  •  
    1. typedef NS_OPTIONS(NSUInteger, UIInterfaceOrientationMask) { 
    2.  
    3.     UIInterfaceOrientationMaskPortrait = (1 << UIInterfaceOrientationPortrait), 
    4.  
    5.     UIInterfaceOrientationMaskLandscapeLeft = (1 << UIInterfaceOrientationLandscapeLeft), 

        推荐阅读

        2017,最受欢迎的 15 大 Python 库有哪些?

      近年来,Python 在数据科学行业扮演着越来越重要的角色。是以,我根据比来的应用体验,在本文中列出了对数据科学家、工程师们最有效的那些库。因为这些库都开源了,我们大年夜Github上惹人>>>详细阅读


      本文标题:代码处理iOS的横竖屏旋转

      地址:http://www.17bianji.com/lsqh/36388.html

    关键词: 探索发现

    乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

    网友点评
    自媒体专栏

    评论

    热度

    精彩导读
    栏目ID=71的表不存在(操作类型=0)