0

In Swift,I have a tableview and in that many tableview cells. In the tableview cell I have a UIImageView in which there is an Image . So now I want to dynamically change the colour of the image everytime the tableview loads,so that the image is visible to the user and the transparent colours on the images are maintained everytime the reload of the table happens.

Suppose there is - 1 TableView - multiple cells - cell1(UIImageView - transparent redcolor) - UIImageView(tranparent bluecolor) - cell3(transparent yellowcolor) so on........how to do it dynamically?

1 Answers1

1

You have two options:

  1. configure the bleeding color in cellForRowAtIndexPath. Specifically you need to set the .backgroundColor property on the UIImageView that holds the image.
  2. have a configureWithColor method in the custom cell (if you have a custom cell) and do the color configuration there.
Earl Grey
  • 7,426
  • 6
  • 39
  • 59