iPhone:在mpMoviePlayerController顶部保留视图 [英] iphone: Preserve view on top of mpMoviePlayerController
问题描述
我有一个mpMoviePlayerController,在它的顶部有一个子视图.当用户点击mpMoviePlayerController的全屏按钮时,子视图消失,仅当我返回原始大小时才出现.有没有办法保留子视图?有没有办法获得缩放"的moviePlayer的引用?
I have a mpMoviePlayerController, and I have subview on top of it. When the user taps the fullscreen button of the mpMoviePlayerController, the subview disappears, and only appears when I go back to the original size. Is there a way to keep the subview? Is there a way to get a reference of the "scaled" moviePlayer?
推荐答案
快速草稿:
- 像这样捕获MPMoviePlayerWillEnterFullscreenNotification:
[[NSNotificationCenter defaultCenter] addObserver:self 选择器:@选择器(MPMoviePlayerDidEnterFullscreen :) 名称:MPMoviePlayerDidEnterFullscreenNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(MPMoviePlayerDidEnterFullscreen:) name:MPMoviePlayerDidEnterFullscreenNotification object:nil];
- 在MPMoviePlayerDidEnterFullscreen内,将该子视图添加到当前的keyWindow中,如下所示:
[[[UIApplication sharedApplication] [keyWindow] addSubview:mySpecialSubview]
[[[UIApplication sharedApplication] keyWindow] addSubview:mySpecialSubview]
这篇关于iPhone:在mpMoviePlayerController顶部保留视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!