Fullscreen youtube video, rotation, and the status bar (iOS)

江枫思渺然 提交于 2019-12-04 05:17:44

I used this YouTube embed method recently for my app Game Guide: Black Ops 2, and I was having this problem along with being shown the rootViewController when hitting the movie player's "done" button. Checking "Wants Full Screen" on the rootViewController fixed the 20 pixel shift, and to fix the rootViewController being displayed after pushing the "done" button I added this to the rootViewController which was adding a UIViewController (with tableView) as a child which was using [presentViewControllerAnimated:(BOOL) completion:nil] to show the ViewController with the YouTube Video Embed.

Now everything is working perfectly... check out the Videos tab in my app if you want to see how it behaves.

-(void)viewDidAppear:(BOOL)animated {
    NSLog(@"Main View viewDidAppear...");
    [super viewDidAppear:animated];
    [self dismissViewControllerAnimated:YES completion:nil];

}

user1350188

I had a similar problem.

I created views in storyboard. Checking Wants full Screen in layout section of view controller settings solved it for me.

If by any chance you're using a UITabBarController, you must install this view as the root of your window. Unlike other view controllers, a tab bar interface should never be installed as a child of another view controller.

To try to add to your info.plist next key: UIStatusBarHidden ("Status bar is initially hidden") with value YES.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!