当 MPMovieControlStyle = MPMovieControlStyleNone 时如何触摸/单击 MPMoviePlayerController 视图

发布于 2024-11-16 04:38:19 字数 94 浏览 3 评论 0原文

在我的一个应用程序中,我不想显示任何视频控制器。但我需要接触媒体播放器视图。我需要在触摸电影播放器​​时执行一些其他操作。我怎样才能实现它。请帮忙

提前致谢。

In one of my application, I don't want to show any video controllers. But I need to get the touch on the media player view. I need to do some other action on touch on the movie player. How can I implement that. Please help

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

执妄 2024-11-23 04:38:19

您始终可以将 UITapGestureRecognizer 附加到视图并处理点击。

UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
[moviePlayer.view addGestureRecognizer:tap];
[tap release];

并在 handleTap 中处理点击:

- (void)handleTap:(UITapGestureRecognizer *)gesture {
    // Do some other action as intended.
}

当然这仅适用于 iOS 3.2 及更高版本。

You can always attach a UITapGestureRecognizer to the view and handle the taps.

UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
[moviePlayer.view addGestureRecognizer:tap];
[tap release];

And handle the tap in handleTap:

- (void)handleTap:(UITapGestureRecognizer *)gesture {
    // Do some other action as intended.
}

Of course this works only on iOS 3.2 and later.

顾忌 2024-11-23 04:38:19

您还可以使用 UIGestureRecognizer 的委托方法。

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch;

You can also use this delegate method of UIGestureRecognizer.

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文