8
votes

Is there a way to customize the color of the minus sign delete button when a UITableView is in edit mode? Designer needs it to be a deeper red to be consistent with our app's color scheme. Please note that I am talking about the circle minus sign delete icon on the left, not the delete confirmation buttons on the right:

enter image description here

SO posts I have found such as this one are all about customizing the delete confirmation buttons on the right hand side.

1
Thank you @Mrunal , that one is also about the swipe to left delete button - "UITableViewCellDeleteConfirmationControl" refers to the confirmation button that shows up after tapping the little crossSeaJelly
I am trying to find this also!That Guy

1 Answers

0
votes

this function works for me, just put it before return the cell in cellForRowAtIndexPath table view delegate method:

+(void) setImageToDeleteBtnInCell:(UITableViewCell*) cell image:(UIImage*) image{
for (UIView *subv in cell.subviews){
    if ([NSStringFromClass([subv class]) isEqualToString:@"UITableViewCellEditControl"]) {
        int i = 0;
        for (UIView *imgV in subv.subviews){
            if (i == 1){
                if([imgV isKindOfClass:[UIImageView class]]){

                    ((UIImageView*) imgV).image = image;
                    //imgV.tintColor = [ObjcThemeConnector getMainColor];
                }
            }
            i++;
        }
    }
}}