MPMoviePlayerViewController - 如何拦截或更改完成按钮的功能
我正在使用 MPMoviePlayerViewController。我有一个 UINavigationController,但我没有推送它,而是调用了presentModalViewController。这是因为我希望 MPMoviePlayerViewController 具有交叉溶解过渡(并且我可以将 modalTransitionStyle 设置为该过渡)。它显示正确,并淡入到位。然而,当它完成时,它会导致前一个视图滑动到位。这不是我想要的。我尝试将 modalTransitionStyle 和 modalPresentationStyle 设置为无效。
我还对 MPMoviePlayerViewController 进行了子类化,但无法弄清楚如何拦截其在播放完毕或按下“完成”按钮时自行消失的默认功能。也许如果我能做到的话,我就能解决上述问题。
I'm using an MPMoviePlayerViewController. I have a UINavigationController, but instead of pushing it I call presentModalViewController. This is because I want the MPMoviePlayerViewController to have a cross dissolve transition (and I can set the modalTransitionStyle to that). It appears correctly, and fades into place. However, when it finishes, it causes the previous view to slide up into place. This is not what I want. I've tried setting the modalTransitionStyle and modalPresentationStyle to no effect.
I've also subclassed the MPMoviePlayerViewController but couldn't figure out how to intercept its default functionality of dismissing itself when finished playing or when the Done button is pressed. Perhaps if I could do that I could fix the above problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议您挂钩 MPMoviePlayerDidFinishNotification 和 MPMoviePlayerWillExitFullScreenNotification 的通知处理程序。一旦播放完成/完成/停止,就会调用前者。一旦用户点击 MPMoviePlayerController 的全屏界面中的“完成”按钮,就会发送后者。
I would suggest you to hook in notification handlers for
MPMoviePlayerDidFinishNotification
andMPMoviePlayerWillExitFullScreenNotification
. The former is invoked once the playback is finished / done / stopped. The latter is sent once the user taps on the DONE button from theMPMoviePlayerController
's fullscreen interface.