0

Hello i have the imageview

enter image description here

The css i got from boss is : /* Rectangle 3: */ background-image: linear-gradient(-180deg, rgba(137,129,129,0.00) 0%, rgba(0,0,0,0.51) 100%);

I search many websites but it's seem impossible. I read that post Drawing gradient over image in ios then i think is that a solution to apply that css to my image. Or convert this css to objective C code.

Does someone meet same problem?

kemdo
  • 1,429
  • 3
  • 15
  • 29

1 Answers1

0

For this case, you can use gradient color as you already told. The trick is, put gradient color to a view and place that view over image view, and than set its opacity (alpha) to 0.51f.

You check here for a CAGradientLayer example and another option is using a great color library Chameleon for creating gradient color and layer.

Clown
  • 163
  • 1
  • 12