UItextview Transparent Color IOS

u.gen picture u.gen · Jun 17, 2012 · Viewed 8.8k times · Source

I want to set my UItextview s color transparent but not completely transparent. I want little bit gray or black at the background exactly like the picture

enter image description here

I am using this code right now

 _textView.backgroundColor = [UIColor clearColor];

how can I make it transparent like in the picture above? Any example Code?

Answer

somedev picture somedev · Jun 17, 2012

You should use something like this:

_textView.backgroundColor = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.5];

where alpha - parameter for transparent ( 50% in example).