Change disclosure indicator color on cell selection

前端 未结 7 1812
甜味超标
甜味超标 2021-01-12 01:44

I\'ve read some posts on this, but still can\'t get the answer to my question.

I have a disclosure indicator. \"

7条回答
  •  -上瘾入骨i
    2021-01-12 02:23

    Try something like this. Probably you'll be able to achieve what you want.

    -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
            for (id obj in cell.subviews){
                if([obj isKindOfClass:[UIButton class]]) {
                    UIButton *button = obj;
                    for(id btnObj in button.subviews){
                        if([btnObj isKindOfClass:[UIImageView class]]) {
                            UIImageView *imgView = btnObj;
                            UIImage *image = [imgView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
                            imgView.image = image;
                            imgView.tintColor = cell.backgroundColor;
                        }
                    }
                }
            }
        }
    

提交回复
热议问题