【代码笔记】iOS-屏幕旋转

代码:

复制代码
- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.title=@"屏幕旋转";
    
}
#pragma  mark -屏幕旋转
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation==UIInterfaceOrientationPortrait);
}
-(BOOL)shouldAutorotate
{
    return YES;
}
-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait;
}
复制代码

 

 

 
 
原文地址:https://www.cnblogs.com/yang-guang-girl/p/5488158.html