Joel Derfner
Joel Derfner

Reputation: 2207

Can I make UITextField invisible?

I checked out iPhone: How can I make a UITextField invisible but still clickable?, but the OP has something else going on and the answers didn't seem to help me out of my fix.

I have a UITextField in which the user has to enter text. Instead of the standard UITextField graphic, I want to use a lovely graphic that's been designed for that purpose. The user would still need to be able to enter text and see the text s/he's entering, but I need the textfield to be invisible so that the graphic can show from underneath it.

How can I do this? Or is there another way to do what I'm after?

Upvotes: 2

Views: 1156

Answers (4)

JSA986
JSA986

Reputation: 5936

Easiest option is to do it in interface builder. Choose the first uitext field style with no border and that's it.

Upvotes: 1

dgund
dgund

Reputation: 3467

Another solution would be hiding the UITextView itself and just adding a transparent button that will call the keyboard to display.

Otherwise, the other answers should work.

Upvotes: 2

iDev
iDev

Reputation: 23278

Adding my comment as an answer. You can try this,

[textField setBackgroundColor:[UIColor clearColor]]; 

And then set the border style as UITextBorderStyleNone.

Upvotes: 3

Rok Jarc
Rok Jarc

Reputation: 18865

something like:

yourTextField.borderStyle = UITextBorderStyleNone;

should do it

Upvotes: 2

Related Questions