平昌建站
平昌做网站
平昌网站制作
平昌微信开发
平昌网站推广
平昌网站维护
平昌网站资讯
关于火炬
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://pcwzsj.com/article/jsdjjo.html
其他资讯
gis在海洋技术中的应用 gis在渔业中的应用
VB.net内存分配 net vb
mysql怎么合成一个字 勿会合成一个字怎么打
阿里云服务器cpu的区别吗 阿里云服务器cpu100怎么办
gis新技术课后总结美术 gis课设心得体会2500字
在线咨询
拨打电话