我需要在 accessoryType
上做一些事情,在 iphone 的 tableview 中单击。如何找到 accessoryType
在 iphone 中的 UITableView
单击。 p>
最佳答案
你需要定义单元格的accessoryType
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
像这样
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
这个accessoryType的行选择方法是
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
但是如果您要为单元格定义任何其他 accessoryType,则可以使用此方法。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
关于iphone - 如何在 iphone 的 tableview 中找到 accessoryType 单击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5138272/