四川平武建站
四川平武网站案例
网站建设知识
四川平武网站建设
网站定制方案
联系四川平武
建站
咨询
售后
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的长按事件
标题URL:
http://scpingwu.com/article/jsdjjo.html
其他资讯
阿里云服务器每天晚上死机 阿里云服务器会死机吗
php+修改post数据 php $_post变量
c语言创建外部函数 c++外部函数调用
c语言程序中必须有函数 c语言程序必须有的函数是
go语言解释器 go语言注解