On my 1) UIView
one (2) UIImageView
will be on this (3) UITextView
.
This UITextView
must be Transparent and we have to view the imageView
.
How can I do this?
On my 1) UIView
one (2) UIImageView
will be on this (3) UITextView
.
This UITextView
must be Transparent and we have to view the imageView
.
How can I do this?
If you only want to make the background (rather than the whole UITextView) transparent, I believe you should be do this via the backgroundColor property it inherits from UIView.
As such...
[yourTextView setBackgroundColor:[UIColor clearColor]];
...should hopefully do the trick.
If however, you want to make the whole UITextView transparent, the alpha property @taskinoor mentions is perfect.
Then, you are done (you don't have to deal with any code if I understand you correctly)!
You can set the alpha of text view to any desired value.
myTextView.alpha = 0.5; // 50% transparent
I use in this way:
[textField setBackgroundColor:[UIColor clearColor]]; //clear background
[textField setBorderStyle:UITextBorderStyleNone]; //clear borders
Swift 4 and higher
For Swift 4 use this:
yourTextView.backgroundColor = UIColor.clear