2

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?

Community
  • 1
  • 1
Joel Derfner
  • 2,207
  • 6
  • 33
  • 45
  • 4
    How about setting background color to clear color? `[textField setBackgroundColor:[UIColor clearColor]];` Also set the border style as `UITextBorderStyleNone` – iDev Jan 21 '13 at 22:58

4 Answers4

3

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

[textField setBackgroundColor:[UIColor clearColor]]; 

And then set the border style as UITextBorderStyleNone.

iDev
  • 23,310
  • 7
  • 60
  • 85
2

something like:

yourTextField.borderStyle = UITextBorderStyleNone;

should do it

Rok Jarc
  • 18,765
  • 9
  • 69
  • 124
2

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.

dgund
  • 3,459
  • 4
  • 39
  • 64
1

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

JSA986
  • 5,870
  • 9
  • 45
  • 91