SpaceDust__
SpaceDust__

Reputation: 4914

UItextview Transparent Color IOS

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?

Upvotes: 9

Views: 9213

Answers (2)

Jon Burgess
Jon Burgess

Reputation: 2115

Does this do what you want? (You may need to experiment with the values).

_textView.backgroundColor = [UIColor colorWithWhite:0.5 alpha:0.5];

Upvotes: 4

somedev
somedev

Reputation: 801

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).

Upvotes: 6

Related Questions