如何在iphone sdk xcode中更改uiimage颜色

The*_*ler 3 iphone

我使用不同的图像,我想包括更改颜色选项.但我不能.有谁帮我?

Lil*_*ard 8

如果你想要做的图像着色,看到的UIImage + Tint.m在kballard/MGImageUtilities.如果你想批发颜色替换(例如把图像作为一个轮廓和改变整个颜色以一个平面彩色),看到的UIImage + Tint.m在mattgemmell/MGImageUtilities.


Ank*_*ain 8

它最新,最简单的方法.

           theImageView.image = [theImageView.image     imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
           [theImageView setTintColor:[UIColor redColor]];
Run Code Online (Sandbox Code Playgroud)