我的iPhone应用程序是一个纵向导向的应用程序,在我的应用程序中,我有UITableView一个UIWebView在第一个UITableCell.该UIWebView节目嵌入YouTube视频.当我点击视频播放时,它进入全屏模式.我需要做的是,允许用户旋转他们的设备并以横向模式播放视频.然后,当视频停止时,只允许再次使用肖像.我设置为在视频进入全屏并且全屏显示时收听通知.但我不知道如何以编程方式允许用户旋转界面方向.
所以我通常在传递通知时调用了2个方法
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeStarted:) name:@"UIMoviePlayerControllerDidEnterFullscreenNotification" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeFinished:) name:@"UIMoviePlayerControllerDidExitFullscreenNotification" object:nil];
-(void)youTubeStarted:(NSNotification *)notification{
// Entered fullscreen code goes here.
}
-(void)youTubeFinished:(NSNotification *)notification{
// Left fullscreen code goes here.
}
Run Code Online (Sandbox Code Playgroud)
我会在这两种方法中放置什么来仅在视频播放期间改变方向?