changing the color of image in iphone sdk

前端 未结 5 860
花落未央
花落未央 2020-12-29 01:06

I have a image & i want to change the color of that image through programatically.

\"enter

5条回答
  •  青春惊慌失措
    2020-12-29 01:32

    As I've answered here iPhone - How do you color an image? in my opinion the best way to colorize an image from iOS 7 is by using

    myImageView.image = [[UIImage imageNamed:@"myImage"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
    

    and then change the tintColor of the imageView or whatever contains the image.

提交回复
热议问题