MPMoviePlayerController 视图在呈现模态视图控制器时消失

发布于 2024-10-08 04:09:54 字数 210 浏览 0 评论 0原文

当我呈现模态视图控制器时,包含 MPMoviePlayerController 视图的视图层次结构就会消失。

它不是显示带有电影和控件的视图,而是在其下方描绘较早的子视图。我检查了主视图控制器的子视图数组以及包括电影播放器​​视图在内的所有视图退出。

在模态视图控制器完成后强制添加电影播放器​​视图不会将电影播放器​​视图带回顶部。

欢迎任何建议/想法吗?

My view hierarchy containing the view from a MPMoviePlayerController vanishes the moment I present a Modal View Controller.

Instead of displaying a view with a movie and controls it depicts an earlier subview beneath it. I checked the subview array of the main view controller and all views including the movie player view exits.

Forcibly adding the movie player view after the modal view controller is done does not bring movie player view back on top.

Would welcome any suggestions/thoughts ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

素罗衫 2024-10-15 04:09:54

您的问题并非特定于 MPMoviePlayerController。 任何当你呈现一个模态视图控制器时,它下面的其他视图控制器的所有视图都会消失。

只需使用几个简单的视图控制器即可尝试一下。

在应用程序委托中,将窗口背景颜色设置为红色:

[self.window setBackgroundColor:[UIColor redColor]];

然后添加一个具有绿色背景的视图控制器:

UIViewController *vc = [[UIViewController alloc] init];
[[vc view] setBackgroundColor:[UIColor greenColor]];
self.window.rootViewController = vc;

最后,创建另一个具有透明背景的视图控制器,并以模态方式呈现它:

UIViewController *vc2 = [[UIViewController alloc] init];
[[vc2视图]setBackgroundColor:[UIColorclearColor]];
[vc PresentModalViewController:vc2 动画:YES];

您希望通过透明 VC 看到绿色 VC,但实际上您看到的是红色(即,您看到了窗口)。

your problem isn't specific to the MPMoviePlayerController. any time you present a modal view controller, all of the views from other view controllers beneath it disappear.

try it out with just a couple of simple view controllers.

in the app delegate, set your window background color to red:

[self.window setBackgroundColor:[UIColor redColor]];

then add a view controller with a green background:

UIViewController *vc = [[UIViewController alloc] init];
[[vc view] setBackgroundColor:[UIColor greenColor]];
self.window.rootViewController = vc;

finally, create another view controller with a transparent background, and present it modally:

UIViewController *vc2 = [[UIViewController alloc] init];
[[vc2 view] setBackgroundColor:[UIColor clearColor]];
[vc presentModalViewController:vc2 animated:YES];

you'd expect to see the green VC through the clear VC, but instead you see red (ie, you see the window).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文