1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath{ return YES; }
- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewRowAction *deleteRowAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"删除" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) { [self deleteCommodityAction:indexPath.row]; }]; deleteRowAction.backgroundColor = COLOR_RGB(255,88,112); NSString *str ; if (_upLoad == 0) { str = @"下架"; }else { str = @"上架"; } UITableViewRowAction *moreRowAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:str handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
[self stateChangeAction:indexPath.row]; }]; moreRowAction.backgroundColor = COLOR_RGB(255, 171, 88);
return @[deleteRowAction, moreRowAction]; }
|
近期评论