问题
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?
回答1:
There's no standard way to do this. Here are your options.
You could set the MPMoviePlayerController's
controlStyle to None and create your own custom controls. Cons: this is a lot of work.
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.
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.
来源:https://stackoverflow.com/questions/13855906/remove-hide-full-screen-button-from-mpmovieplayercontroller-standard-controls