Iphone 设置UITableViewCell中DetailDisclosure按钮的操作
我已在我的应用程序中设置UITableViewCellIphone 设置UITableViewCell中DetailDisclosure按钮的操作,iphone,uitableview,Iphone,Uitableview,我已在我的应用程序中设置UITableViewCell productsCell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;//productCell is of type UITableViewCell 以前使用过此accessoryAction属性。但现在它被弃用了 如何做到这一点。 提前感谢。在您的学员中实施此方法: - (void)tableView:(UITableView *)tableView a
productsCell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;//productCell is of type UITableViewCell
以前使用过此accessoryAction属性。但现在它被弃用了
如何做到这一点。
提前感谢。在您的学员中实施此方法:
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
indexPath
将指向被点击的辅助单元
或者试试这个:
UITableViewCell *cell;
UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(accessoryTapped)];
[cell.accessoryView addGestureRecognizer:recognizer];
[recognizer release];
我做到了。但方法没有被调用。请确保我使用的是UITableViewCell的单个单元格。我没有使用UITableView。您使用的是没有表格的单元格吗?是的。我使用它没有手机。在我的需求表格视图中不适合。那么我只能建议将
uitappesturerecognizer
添加到您的单元格中。accessoryView
。