如何防止 MPMoviePlayerViewController 中的捏合手势?
由于MPMoviePlayerViewController
支持捏合手势(两根手指分开)使电影播放器全屏,有什么方法可以删除这个手势?因为如果我使用手势,电影仍然会在没有视频的情况下播放。我认为电影控制器的视图已从超级视图中删除。
我尝试覆盖 touchesBegan
和通知 WillEnterFullScreenNotification
& DidEnterFullScreenNotfication
,但它不起作用。
As MPMoviePlayerViewController
supports pinch gesture ( two fingers move apart ) to make the movie player full screen, is there any method to remove this gesture? Because if I use the gesture, the movie is still playing without the video. I think the view of movie controller is removed from super view.
I tried overriding touchesBegan
and the notification WillEnterFullScreenNotification
& DidEnterFullScreenNotfication
, but it didn't work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我在将视频显示从横向重新定向为纵向时遇到了类似的问题。我通过访问 MPMoviePlayerController 对象的 view 属性并将
userInteractionEnabled
设置为NO
解决了这个问题。这可以防止任何用户触摸通过并更改
MPMoviePlayerController
的方向或全屏状态。I had a similar issue with the "pinch gesture" reorienting the video display from landscape to portrait. I solved it by accessing the view property of the
MPMoviePlayerController
object and settinguserInteractionEnabled
toNO
.This prevents any user touches from getting through and changing the orientation or fullscreen status of the
MPMoviePlayerController
.就我而言, jontron/curhipster 接受的答案不起作用。
但是,当我将 moviePlayers
controlStyle
设置为MPMovieScalingModeFill
时,讨厌的捏合被忽略了。我的代码:
In my case the accepted answer from jontron/curhipster didn't work.
But when I set the moviePlayers
controlStyle
toMPMovieScalingModeFill
the pesky pinch was ignored.My code:
这是正确的解决方案
This is the correct solution