6条回答 默认 最新
jasonjz 2015-12-03 06:10关注没搞清楚你要怎么样, Controller 实现代理
设置 tableView.delegate=self;
tableView.dataSource=self;
然后实现 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//在这个方法里就可以监听到 如果是不同的cell 响应不同的方法 如果位置固定的话 你可以这样做if (indexPath.section==0) { if (indexPath.row==0){ //.... } } }或者你是需要这样的:
//添加关联的方法 Tap:
UITapGestureRecognizer *Tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(Tap:)];
Tap.numberOfTapsRequired = 1;//点击一次触发
Tap.numberOfTouchesRequired = 1;//点击需要的手指数量
[UIView addGestureRecognizer:Tap]; //-(void)Tap { // do what you want }本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
