开发者

How to get the add editing controls in a uitableviewcell to track touches

开发者 https://www.devze.com 2022-12-09 17:52 出处:网络
Is there a way to get the add (the green circle with the white plus) editing control to track touches.

Is there a way to get the add (the green circle with the white plus) editing control to track touches. The contacts program for example allows the user to touch either the cell itself or the circles on the left to carry out the add action. Unfortunately, I don't get the same behaviour when I edit my tableViewCells. Only touches on the t开发者_如何学PythonableViewCell itself are tracked, touching the add green circle does nothing.

Is there any way to enable tracking of touches for these add editing controls.

Thanks


Did you implement commitEditingStyle in your UITableViewController?

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
    }   
    else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Add a new row to the data source     
    }   
}
0

精彩评论

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

关注公众号