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

时间:2023-12-17 14:48:14

代码:

【代码笔记】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;
}
【代码笔记】iOS-屏幕旋转