触摸并按住 TableViewCell 以显示(工具提示)弹出框,这在 iPhone 中可能吗?

发布于 2024-11-18 15:23:29 字数 170 浏览 0 评论 0原文

根据图片,您能告诉我使用哪个函数来开发此功能吗? 我不确定,它是从 UIPopover 实现的吗? 任何想法,谢谢。

来源来自 Music.app iOS 5 beta 2

在此处输入图像描述

According to image could you please advise me which function use to develop this feature?
i'm not sure, is it implement from UIPopover?
any idea, thank you.

source from Music.app iOS 5 beta 2

enter image description here

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

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

发布评论

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

评论(1

一世旳自豪 2024-11-25 15:23:29

您可以使用 UIGestureRecognizer。具体来说,您正在寻找的是 UILongPressGestureRecognizer

您应该实例化一个并将其附加到您想要跟踪手势的视图:

    UILongPressGestureRecognizer* gestureRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleGesture:)];
    [view addGestureRecognizer:gestureRecognizer];

然后,在您的处理程序方法中,您将执行其余操作:

- (void)handleGesture:(UILongGestureRecognizer *)recognizer {

     if (recognizer.state == UIGestureRecognizerStateBegan) {    

     } else if (recognizer.state == UIGestureRecognizerStateEnded) {

     }
 }

编辑:对于弹出窗口实现,请查看 WEPopover

You can use a UIGestureRecognizer. Specifically, what you are looking for is a UILongPressGestureRecognizer

You should instantiate one and attach it to the view you would like to track the gesture on:

    UILongPressGestureRecognizer* gestureRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleGesture:)];
    [view addGestureRecognizer:gestureRecognizer];

Then, in your handler method you would do the rest:

- (void)handleGesture:(UILongGestureRecognizer *)recognizer {

     if (recognizer.state == UIGestureRecognizerStateBegan) {    

     } else if (recognizer.state == UIGestureRecognizerStateEnded) {

     }
 }

EDIT: for the popover implementation, have a look at WEPopover

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