开发者

Set action on detailDisclosureButton in UITableViewCell

I have set UITableViewCell in my app.

productsCell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;//produc开发者_Python百科tCell is of type UITableViewCell

Previously for this accessoryAction property was used. But now its deprecated.

How to do this. Thanks in advance.


Implement this method in your delegate:

- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath

indexPath will point on the cell which accessory cell was tapped.

Or try this:

UITableViewCell *cell;
UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(accessoryTapped)];
[cell.accessoryView addGestureRecognizer:recognizer];
[recognizer release];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜