UITableviewCell 中的触摸持续时间

发布于 2024-09-18 13:54:10 字数 187 浏览 1 评论 0原文

有没有办法在不子类化的情况下获取 UITableViewCell 的触摸持续时间?原因是我想在用户持有单元格时显示模态视图控制器,并在用户点击单元格时显示详细视图。我已经有一个使用默认 UITableViewCells 的工作应用程序(但最近发现需要保持事件),这就是我真的不想使用子类化的原因。有什么想法吗?

非常感谢

朱尔斯

Is there a way to get the touch duration of a UITableViewCell without subclassing? The reason being I want to display a modal view controller when the user holds a cell and display a detail view when the user taps a cell. I already have a working app using default UITableViewCells (but recently found a need for the hold event) which is the reason I dont really want to have to use subclassing. Any thoughts?

Many thanks

Jules

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

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

发布评论

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

评论(1

明月夜 2024-09-25 13:54:10

如果您可以接受 3.2+ 兼容性,您可以为不同类型的触摸(长触摸)添加 UIGestureRecognizer

If you can live with 3.2+ compatibility, you can add UIGestureRecognizer for different type of touches (long touch).

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