lundi 26 janvier 2015

iOS - UIImage tinting highlight always grey


Vote count:

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;
}];
}


asked 1 min ago







iOS - UIImage tinting highlight always grey

Aucun commentaire:

Enregistrer un commentaire