导航栏下推视频和控件
摘要:我想知道为什么 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否还设置了视图的
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 thebarStyle
toUIBarStyleBlackTranslucent
.