是否全屏

来源:互联网 发布:练字很慢怎么办 知乎 编辑:程序博客网 时间:2024/06/05 07:02

 if (!_isFullScreen) {

        

        _isFullScreen =YES;

        [[UIApplicationsharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight];

        [[UIApplicationsharedApplication] setStatusBarHidden:YESwithAnimation:UIStatusBarAnimationNone];

        CGRect rect = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);

        self.view.bounds = rect;

        self.view.transform = CGAffineTransformMakeRotation(M_PI_2);

        MYMoviePlayerConroller.view.frame =self.view.bounds;

        _playerView.frame =MYMoviePlayerConroller.view.frame;

        NSLog(@"%f",MYMoviePlayerConroller.view.frame.size.width);


        

    }else {

       

        _isFullScreen =NO;

  

        self.view.transform =CGAffineTransformIdentity;

        CGRect rect = CGRectMake(0, 0, SCREEN_HEIGHT, SCREEN_WIDTH);

        self.view.bounds = rect;

        MYMoviePlayerConroller.view.frame = _currentframe;

        _playerView.frame =MYMoviePlayerConroller.view.frame;

        [[UIApplicationsharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait];

    }



0 0
原创粉丝点击