Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a transparent UITextField?

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?

like image 758
good guy Avatar asked Jan 05 '11 10:01

good guy


People also ask

What is a UITextField?

An object that displays an editable text area in your interface.

What is TextField in swift?

A TextField is a type of control that shows an editable text interface. In SwiftUI, a TextField typically requires a placeholder text which acts similar to a hint, and a State variable that will accept the input from the user (which is usually a Text value).


1 Answers

Objective-C

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.

like image 196
John Parker Avatar answered Sep 19 '22 09:09

John Parker