新都图禾美页建站
新都网站案例
网站建设知识
新都网站建设
网站定制方案
联系图禾美页
建站
咨询
售后
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.xdwzjz.cn/article/jsdjjo.html
其他资讯
c语言解析时间的函数 c语言时间获取
阿里云服务器1万人在线 阿里云服务器1万人在线使用
wordpress主题乱 wordpress主题放在什么位置
菜鸟教程go语言 菜鸟教程go语言版
php数据模糊 php数据格式