iOS Cross screen issues

Source: Internet
Author: User

Solve the problem of horizontal screen first
1. Project Settings only support vertical screen

The 2.AppDelegate window setting supports all

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{ return UIInterfaceOrientationMaskAll;}

3.UINavigationController or Baseviewcontroller only support vertical screen
(This ensures that the application supports horizontal screen, and the usual VC is vertical screen, and then to cross-screen VC present out)

- (BOOL)shouldAutorotate{    return YES;}- (NSUInteger)supportedInterfaceOrientations{    return UIInterfaceOrientationMaskPortrait;}

4. Player interface present out, support the screen

-(BOOL)shouldAutorotate{    return YES;}
- (NSUInteger)supportedInterfaceOrientations{    return UIInterfaceOrientationMaskAll;}

Player interface present out, support horizontal screen

-(BOOL)shouldAutorotate{    return YES;}
- (NSUInteger)supportedInterfaceOrientations{    return UIInterfaceOrientationMaskLandscape;}

Status bar set above ios7.0

-(void ) Playerviewdelegatesetstatusbarhiden: (bool) is_hiden{    Self.stauts_bar_hiden = Is_hiden; [self Prefersstatusbarhidden]; //hide or show //update StatusBar [self Performselector: @selector (setneedsstatusbarappearanceupdate)]; //Refresh status bar}-(bool) prefersstatusbarhidden{return self.stauts_bar_hiden;} 


Turn from: blog.csdn.net/u012241552/article/details/49023729
 

iOS Cross screen issues

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.