Modal View Controller Won't Start in Landscape Mode

后端 未结 7 1397
死守一世寂寞
死守一世寂寞 2020-12-10 17:10

I have a navigation based app that has a detail view (UIWebView) with action buttons across the bottom in a UIToolbar. I want to add \'notes\' when the \'notes\' button is

7条回答
  •  有刺的猬
    2020-12-10 18:07

    I had the task to show a video player in landscape mode.

    AVPlayerViewController *playerViewController = [AVPlayerViewController new];
    //Player init code goes here....
    
    // #define degreesToRadian(x) (M_PI * (x) / 180.0) - was defined previously in a class header
    
    playerViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    playerViewController.view.transform = CGAffineTransformMakeRotation(degreesToRadian(90));
    playerViewController.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
    
    [self presentViewController:playerViewController animated:YES completion:nil];
    

提交回复
热议问题