How to hide UITextField border?

user984694 picture user984694 · Nov 21, 2013 · Viewed 36.5k times · Source

I have a UITextField and I am trying to make the UITextField border invisible so that the background and UITextField would have the same color and there would be a seamless look. But the problem is I also use a placeholder and there is a border that I cannot remove. I already tried:

textOption.borderStyle = UITextBorderStyleNone;
textOption.layer.borderWidth = 0;

It didn't work. Would you please help me on that? I still can see the border of the UITextField. fyi: The UITextView that I use doesn't have this issue => There is no placeholder in UITextViews.

Answer

If you want to remove the textfield border you can do it directly with interface builder: enter image description here