从MPMoviePlayerController标准控件中删除/隐藏全屏按钮 [英] Remove/hide Full screen button from MPMoviePlayerController Standard Controls
问题描述
我希望删除/隐藏来自 MPMoviePlayerController
标准控件的全屏按钮,因为全屏模式会产生很多问题而且不是我的应用程序的要求。我只想要播放
,停止
,转发
,反向
控制
。有人可以帮助我吗?
I want to remove/hide the full screen button from MPMoviePlayerController
standard controls as full screen mode is creating lot of problems and also not a requirement of my app.I just want the play
,stop
,forward
,reverse
controls
. Can anybody help me?
推荐答案
没有标准的方法可以做到这一点。以下是您的选择。
There's no standard way to do this. Here are your options.
您可以将 MPMoviePlayerController的
controlStyle设置为None并创建自己的自定义控件。缺点:这是很多工作。
You could set the MPMoviePlayerController's
controlStyle to None and create your own custom controls. Cons: this is a lot of work.
您可以使用 NSNotificationCenter
拦截 MPMoviePlayerWillEnterFullscreenNotification
并立即将fullScreen模式设置为NO。缺点:基于用户的iOS版本,这可能会导致闪烁或一些毛病效果。
You could use the NSNotificationCenter
to intercept the MPMoviePlayerWillEnterFullscreenNotification
and immediately set fullScreen mode to NO. Cons: based on the iOS version of the user, this may cause a flicker or some glitchy effect.
您可以通过 MPMoviePlayerController
查看的子视图,直到你到达 MPInlineTransportControls
视图,其中包含控件,滑块
和播放/暂停按钮
和全屏按钮,全部为 MPTransportButton
。找到那个,你可以隐藏它或从超级视图中删除它。缺点:截至目前,这通过了应用程序商店评论,并在所有当前支持的 iOS
版本上完美运行。但这可能随时改变。如果Apple决定重做他们的默认视频播放器,您最终可能会使用非工作代码。
You could go through the MPMoviePlayerController
view's subviews until you get to a MPInlineTransportControls
view which contains the controls, the slider
and the play/pause button
and the full screen button which are all of class MPTransportButton
. Find that one and you can hide it or remove it from its superview. Cons: as of right now this passes app store reviews and works perfectly on all currently supported iOS
versions. But this could change at any time. If Apple decides to redo their default video player you may end up with non working code.
这篇关于从MPMoviePlayerController标准控件中删除/隐藏全屏按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!