0

I have this button where the background colour is white and the image tint is colour x. When selected, I want the colour to swap - bg is x (which I can do easily) but the image tint always is grey (or a darker version of the colour I set). How can I change it?

UIImage *image = [UIImage imageNamed:@"House"];
        image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];

        [self setImage:image forState:UIControlStateNormal];
        self.imageView.contentMode  = UIViewContentModeScaleAspectFit;

//

- (void)highlight {
    [super highlight];
    [UIView animateWithDuration:HIGHLIGHT_ANIMATION_TIME animations:^{
        self.tintColor = [UIColor whiteColor];
    }];
}

- (void)unhighlight {
    [super unhighlight];
    [UIView animateWithDuration:HIGHLIGHT_ANIMATION_TIME animations:^{
        self.tintColor = self.colour;
    }];
}
4

1 に答える 1