문제

I am aware of tintcolor property of UINavigationBar and it is set to its default in my project. This way the icons on this bar have blue color.

But when I add same icons in UITableViewCells, they are of grey (original png) color.

Is there a way to make it have same color as the ones on the Navigation Bar?

도움이 되었습니까?

해결책

In iOS7 you can use a new property in order to redraw an UIImage so you can have it with the same color as the tint color.

Here is an example:

UIImage *backButtonImage = [UIImage imageNamed:@"imageName.png"];
backButtonImage = [backButtonImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];

Finally you will need to set either the setTintColor property of the object where you adding that UIImage or the property in the whole project.

Hope this helps!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top