SwiftReorder icon indicating copy to clipboard operation
SwiftReorder copied to clipboard

Tinted buttons in cells changing colors

Open valeriologiudice opened this issue 7 years ago • 1 comments

Hello, great library! I have an issue for buttons with images that I tint to change their color inside a cell. When I start the dragging the cell the tint color that I set is re-setted to the buttons image original colors. For example I've set the tint color for those buttons to be green and when dragging starts the buttons became black, witch is the image original color. Thanks again for this very useful library, best.

valeriologiudice avatar Nov 02 '17 20:11 valeriologiudice

@valeriologiudice I don't think this is an issue with this library. I forgot where I found the solution, but this is just an ios thing - the tints/backgrounds sometimes get reset when a cell is set to selected or highlighted. In order to fix this, I recommend overriding a couple methods in your UITableViewCell:

- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated
{
    [super setHighlighted:highlighted animated:animated];
    // re-set any tint/background that is changed to what it should be
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    // re-set any tint/background that is changed to what it should be
}

thejeff77 avatar Jul 26 '19 13:07 thejeff77