[问题] UITableView 点选必须长按才能呼叫问题

楼主: chengpocheng (阿璋仔)   2015-03-08 15:51:26
大家好
目前碰到的问题是
我在UITableView里用xib客制Cell
当去使用didSelectRowAtIndexPath时候
必须要长按才能触发这个event
就像是在cell上面加上了UILongPressGesture的感觉
但其它页面的UITableView却没有这个问题
写法完全一模一样
不知为何同样的写法会有不同的回应时间
上网google的结果
大多是说是加了其他手势的关系
但我并没有加任何手势event到里面
可否麻烦各位给我一点指点
附上片段程式码
- (void)viewDidLoad {
[super viewDidLoad];
[demoTableView registerNib:[UINib nibWithNibName:@"customTableViewCell" bundle:nil] forCellReuseIdentifier:@"Cell"];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellIdentifier = @"Cell";
customTableViewCell *cell = (customTableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (!cell) {
cell = [[surveyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
}
return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"test");
}
作者: stweber2001 (Weber)   2015-03-08 15:59:00
你的底层view(如self.view等等)上是否有其他手势?
楼主: chengpocheng (阿璋仔)   2015-03-08 16:34:00
我刚检查过确定没有加上任何手势而且又发现Swipe手势可以马上触发 好奇怪
作者: kokuyoku (天龙狂想曲)   2015-03-09 10:48:00
UITableViewCell的subview清空也是一样吗?

Links booklink

Contact Us: admin [ a t ] ucptt.com