第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