ios: change the colors of a UIImage

前端 未结 8 840
旧时难觅i
旧时难觅i 2020-11-27 12:50

I am working on an Iphone application.

I have png pictures that represents symbols. symbols are all black with a transparent background.

Is there a way I can

8条回答
  •  一整个雨季
    2020-11-27 13:21

    You can create UIView which store UIImageView and change UIview background Color.

    UIView *viewForImage = ....;
    UIImageView *imageView = .....;
    ...
    
    [viewForImage addSubview: imageView];
    [self.view addSubview:viewForImage];
    ...
    

    and then use for example

    [viewForImage setBackgroundColor: [UIColor redColor]];
    

提交回复
热议问题