zoukankan      html  css  js  c++  java
  • iOS 视频播放横屏,隐藏状态栏

       MPMoviePlayerViewController *moviePlayerViewController = [[MPMoviePlayerViewController alloc] init];
        moviePlayerViewController.view.frame = CGRectMake(0, 0, self.view.bounds.size.height, self.view.bounds.size.width);
        moviePlayerViewController.view.center = CGPointMake(self.view.bounds.size.width/2, self.view.bounds.size.height/2);
        CGAffineTransform transform = CGAffineTransformMakeRotation(M_PI/2);
        [moviePlayerViewController.view setTransform:transform];
        [self.view addSubview:moviePlayerViewController.view];
    

    如果需要放大可以设置 moviePlayerViewController.scalingMode 属性,有4种可选。

    你会发现系统状态栏会随着屏幕旋转,这时候最好的方法是将其隐藏

    在viewWillAppear:里[[UIApplication sharedApplication] setStatusBarHidden:YES];

    viewDidDisappear:里[[UIApplication sharedApplication] setStatusBarHidden:NO];

  • 相关阅读:
    HDU 3395 Special Fish
    HDU 3772 Card Game
    poj2078
    poj2138
    poj2008
    poj1951
    poj1782
    到香港读研究生手册
    !!Html:frameset 使用心得
    PHP环境配置:Windows下XAMPP的安装说明与使用
  • 原文地址:https://www.cnblogs.com/sparks/p/3970057.html
Copyright © 2011-2022 走看看