Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 电影结束时在电影播放器中显示控件_Iphone_Ios_Video_Mpmovieplayercontroller_Movieplayer - Fatal编程技术网

Iphone 电影结束时在电影播放器中显示控件

Iphone 电影结束时在电影播放器中显示控件,iphone,ios,video,mpmovieplayercontroller,movieplayer,Iphone,Ios,Video,Mpmovieplayercontroller,Movieplayer,我想在电影结束时显示电影播放器控件,因此我将observer添加到NSNotificationCenter: - (void)movieFinishedCallback:(NSNotification*)aNotification { // Obtain the reason why the movie playback finished NSNumber *finishReason = [[aNotification userInfo] objectForKey:MPMovie

我想在电影结束时显示电影播放器控件,因此我将observer添加到NSNotificationCenter:

- (void)movieFinishedCallback:(NSNotification*)aNotification
{
    // Obtain the reason why the movie playback finished
    NSNumber *finishReason = [[aNotification userInfo] objectForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey];

    if ([finishReason intValue] == 0)
    {
        [self showControls];
    }

   // Handle other reasons 
}


- (void)showControls
{
    for(id views in [[[self.playerVC moviePlayer] view] subviews]){
        for(id subViews in [views subviews]){
            for (id controlView in [subViews subviews]){
                [controlView setAlpha:1.0];
                [controlView setHidden:NO];
            }
        }
    }
}
到目前为止,一切正常,控件都出现了,但当我点击屏幕以隐藏它们时,控件消失并很快再次出现(类似于flash),然后我需要再次点击视图以隐藏控件


有人知道我为什么会有这个问题吗?或者在视频结束时有没有其他方法显示控件

首先调试并打印MPMoviePlayerView的子视图,写下子视图并找到控件视图的名称

这是我在应用程序中进行的调试

打印子视图的说明:
controlView的打印说明:
打印子视图的说明:
打印视图说明: