How do I create a transparent UITextField?


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.

You can set the alpha of text view to any desired value.

myTextView.alpha = 0.5;    // 50% transparent

  1. Go down to the utilities panel (on the right) and scroll down to the "View" section.
  2. Then, see the "Background" field. I already have my UITextField/UITextView transparent. Your's should have a solid color, right? That means that the object is not transparent. enter image description here
  3. Open the pop-up menu and press "Clear Color". Then, you must see the color to be half black and half white (like mine). That is how Xcode signifies transparency.

Then, you are done (you don't have to deal with any code if I understand you correctly)!