標籤:
首先解決橫屏問題
1.工程設定只支援豎屏
2.AppDelegate的window設定支援所有
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{ return UIInterfaceOrientationMaskAll;}
3.UINavigationController或者BaseViewController只支援豎屏
(這樣保證了應用程式支援橫屏,而且平常的vc是豎屏,然後要橫屏的vc present出來)
- (BOOL)shouldAutorotate{ return YES;}- (NSUInteger)supportedInterfaceOrientations{ return UIInterfaceOrientationMaskPortrait;}
4.播放器介面present出來,支援橫豎屏
-(BOOL)shouldAutorotate{ return YES;}
- (NSUInteger)supportedInterfaceOrientations{ return UIInterfaceOrientationMaskAll;}
播放器介面present出來,支援橫屏
-(BOOL)shouldAutorotate{ return YES;}
- (NSUInteger)supportedInterfaceOrientations{ return UIInterfaceOrientationMaskLandscape;}
//狀態列設定ios7.0以上
-(void)playerViewDelegateSetStatusBarHiden:(BOOL)is_hiden{ self.stauts_bar_hiden = is_hiden; [self prefersStatusBarHidden]; //隱藏還是顯示 //更新statusbar [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)]; //重新整理狀態列}- (BOOL)prefersStatusBarHidden{ return self.stauts_bar_hiden;}
轉自:blog.csdn.net/u012241552/article/details/49023729
iOS橫屏問題