iOS--解决屏幕旋转后, presentController
作者:
请叫我大帅666 | 来源:发表于
2019-08-19 19:38 被阅读0次//开始的方向
// 解决旋转屏幕后页面倒置问题
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
UIViewController *currentVc = [self getCurrentVC];
if(currentVc.presentingViewController.preferredInterfaceOrientationForPresentation == UIDeviceOrientationLandscapeLeft || currentVc.presentingViewController.preferredInterfaceOrientationForPresentation == UIDeviceOrientationLandscapeRight){
return currentVc.presentingViewController.preferredInterfaceOrientationForPresentation;
}else{
if ([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeRight) {
self.interfaceOrientation = UIInterfaceOrientationLandscapeLeft;
return UIInterfaceOrientationLandscapeLeft;
} else if ([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeLeft) {
self.interfaceOrientation = UIInterfaceOrientationLandscapeRight;
return UIInterfaceOrientationLandscapeRight;
}
return self.interfaceOrientation;
}
}
本文标题:iOS--解决屏幕旋转后, presentController
本文链接:https://www.haomeiwen.com/subject/yqxadctx.html
网友评论