繁体   English   中英

如何在tableview中设置触摸单元格的时间?

[英]How to set time for touch the cell in a tableview?

哈我所有人都有一个tableview,当我点击它弹出一个视图的单元格,它的工作对我来说很好,但我的问题是,我想点击2秒弹出窗口出现。也就是说,如果我点击2的单元格第二,然后只有弹出窗口。这可能吗?我怎么能这样做?

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self.view addSubview:MainPopupView];
//MainPopView is the popup that i want to display after2 minit
}

提前致谢。

试试UILongPressGestureRecognizer 您可以设置minimumPressDuration以设置识别手势的时间。

您可以将UILongPressGestureRecognizer添加到表格视图单元格并获取所需的操作。

更新请查看此前的SO问题如何判断用户是否按下了UITableViewCell 2秒钟?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM