您的位置:首页 > 其它

屏幕旋转方向

2015-10-14 11:46 218 查看
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);}

//- (BOOL)shouldAutorotate

//{

//    NSLog(@"让不让我旋转?");

//    return YES;

//}

//

//- (NSUInteger)supportedInterfaceOrientations {

//    NSLog(@"让我旋转哪些方向");

//    return UIInterfaceOrientationMaskAllButUpsideDown;
//}

你可以复写viewcontroller的下面几个模板函数,试试。

- (BOOL)shouldAutorotate
NS_AVAILABLE_IOS(6_0);当前viewcontroller是否支持转屏

- (NSUInteger)supportedInterfaceOrientations;当前viewcontroller支持哪些转屏方向

-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation当前viewcontroller默认的屏幕方向
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: