第30月第13天 supportedInterfaceOrientationsForWindow旋转


1.

对于做视频横屏播放的情况下:做旋转有3种方法。

第一种:就是网上说的用旋转矩阵方法CGAffineTransformMakeRotation来做,直接旋转某个view,之后setFrame,至于状态栏,全屏横屏之后就隐藏吧。这种方法有个弊端是音量图标不能随着一起旋转,QA到时候会挑BUG。

第二种:就是打开工程设置前面也说了弄个导航控制器。

第三种:就是前面说的- (NSUInteger)application:(UIApplication *)applicationsupportedInterfaceOrientationsForWindow:(UIWindow *)window方法。

 https://blog.csdn.net/returningprodigal/article/details/51830909

 

2.

-(UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{
    if (self.isForceLandscape) {
        return UIInterfaceOrientationMaskLandscape;
    }else if (self.isForcePortrait){
        return UIInterfaceOrientationMaskPortrait;
    }
    return UIInterfaceOrientationMaskAll;
}

 

https://blog.csdn.net/ghl2318560278/article/details/51579814


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM