iOS电影播放器​​在多大程度上可以定制和设计样式? [英] To what extent can the iOS Movie Player be customized and styled?

查看:200
本文介绍了iOS电影播放器​​在多大程度上可以定制和设计样式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试完成类似于下图的内容。也就是说,我想添加一个滑出式叠加导航栏和其他叠加功能。一般来说,我也想知道电影播放器​​可以进行哪种自定义。具体来说,我可以从顶部栏添加/删除按钮,我如何将这些点添加到播放栏?谢谢!

I am trying to accomplish something similar to the image below. That is, I would like to add a slide-out overlay navigation bar and other overlay functionality as well. In general I would also just like to know what kind customization is possible with the Movie Player. Specifically, can I add/remove buttons from the top bar, how would I add those dots to the playback bar? Thanks!

http://blog.howcast.com/wp-content/uploads/2010/06/ipad-video.png

推荐答案

根据 MPMoviePlayerController 类引用,将电影播放器​​视图视为不透明结构。您可以添加自己的自定义子视图在电影上叠加内容,但你绝不能修改任何现有的子视图。

所以我强烈建议不要试图修改现有的顶部栏,而是将 controlStyle 属性设置为 MPMovieControlStyleNone ,它完全隐藏了所有默认UI。然后,在电影播放器​​的视图上叠加您自己的用户界面视图。你必须重新实现一些东西,但是电影播放器​​控制器将所有按钮的动作暴露为方法(参见 MPMediaPlayback 协议,用于播放/暂停/搜索/等。)所以这不应该是一个大问题。

So I would strongly recommend against trying to modify the existing top bar and instead set the controlStyle property to MPMovieControlStyleNone which completely hides all the default UI. Then, layer your own user interface views on top of the movie player's view. You'll have to re-implement some stuff, but the movie player controller exposes all its buttons' actions as methods (see the MPMediaPlayback protocol for play/pause/seeking/etc.) so this shouldn't be a big problem.

这篇关于iOS电影播放器​​在多大程度上可以定制和设计样式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆