导航栏下推视频和控件

发布于 2024-12-29 19:57:31 字数 426 浏览 4 评论 0原文

摘要:我想知道为什么 MPMoviePlayerController 被横向导航栏按下。

在我的 iOS 应用程序中,我有一个简单的 tableView。当我点击一个单元格时,我模态呈现一个包装在 UINavigationController 中的 myViewController 实例。 myViewController 有一个 MPMoviePlayerController 实例作为子视图。

moviePlayer 和相关控件被向下推并稍微离开屏幕底部。我可以通过隐藏导航栏来解决这个问题。不过我想在视频中显示导航栏。

防止视频和控件被推下并稍微离开屏幕的最佳/正确方法是什么?

我已经查看了 moviePlayer 的框架、myViewController 视图的框架等,但我仍然是有点困惑。

Summary: I'm wondering why the MPMoviePlayerController is being pushed down by the navigation bar in landscape orientation.

In my iOS app I have a simple tableView. When I tap a cell I modally present an instance of myViewController wrapped in a UINavigationController. myViewController has an instance of MPMoviePlayerController as a subview.

The moviePlayer and associated controls are being pushed down and slightly off the bottom of the screen. I can fix this by hiding the navigation bar. However I want to show the navigation bar with the video.

What's the best/correct way to prevent the video and controls from being pushed down and slightly off screen?

I've looked at the frame of the moviePlayer, the frame of the myViewController's view etc and am still a bit confused.

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

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

发布评论

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

评论(1

电影里的梦 2025-01-05 19:57:31

您是否还设置了视图的 autoresizingMask ?另一方面,如果您希望导航栏覆盖视图的一部分,请将 barStyle 设置为 UIBarStyleBlackTranslucent

Did you also set your view's autoresizingMask? On the other hand if you want the navigation bar to cover part of your view, then set the barStyle to UIBarStyleBlackTranslucent.

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