泸州大橙子建站
泸州网站案例
网站建设知识
泸州网站建设
网站定制方案
联系大橙子
建站
咨询
售后
RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
建站咨询
加盟咨询
定制咨询
服务时间:8:30-17:00
你可能遇到了下面的问题
联系方式
网站制作
网站建设
网络推广
SEO优化
网站推广
新闻中心
这里有您想知道的互联网营销解决方案
uitableviewcell的长按事件
UILongPressGestureRecognizer *lpgr = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
lpgr.minimumPressDuration = 1.0;
//seconds 设置响应时间
lpgr.
delegate
= self;
[mTableView addGestureRecognizer:lpgr];
//启用长按事件
[lpgr release];
-(
void
)handleLongPress:(UILongPressGestureRecognizer *)gestureRecognizer
//长按响应函数
{
CGPoint p = [gestureRecognizer locationInView:mTableView ];
//if(gestureRecognizer.state == UIGestureRecognizerStateBegan)
//{
//NSLog(@"UIGestureRecognizerStateBegan");
//}
//else if(gestureRecognizer.state == UIGestureRecognizerStateEnded)
//{
//NSLog(@"UIGestureRecognizerStateEnded");
//}
//else if(gestureRecognizer.state == UIGestureRecognizerStateChanged)
//{
//NSLog(@"UIGestureRecognizerStateChanged");
//}
//else if(gestureRecognizer.state == UIGestureRecognizerStateCancelled)
//{
//NSLog(@"UIGestureRecognizerStateCancelled");
//}
//else if(gestureRecognizer.state ==UIGestureRecognizerStateFailed )
//{
//NSLog(@"UIGestureRecognizerStateFailed");
//}
NSIndexPath *indexPath = [mTableview indexPathForRowAtPoint:p];
//获取响应的长按的indexpath
if
(indexPath == nil)
NSLog(
@"long press on table view but not on a row"
);
else
NSLog(
@"long press on table view at row %d"
, indexPath.row);
}
当前文章:uitableviewcell的长按事件
当前网址:
http://www.lzwzjz.cn/article/jsdjjo.html
其他资讯
用javascript实现AJAX请求的方法
pycharm中怎么删除bookmark
自定义微信发送给好友,分享到朋友圈的缩略图,链接,标题和摘要
Java数据结构之如何实现HashMap
python有没有必要培训