How do I disable a textfield?

10,370

Solution 1

I believe you are looking for: UITextField.enabled = NO; or UITextField.hidden = YES;

:) Hope that helps!

Solution 2

UITextField.enabled rather than UITextField.Hidden, otherwise you will no longer see your textfield.

Share:
10,370
LawVS
Author by

LawVS

Updated on June 04, 2022

Comments

  • LawVS
    LawVS almost 2 years

    I have a textfield which displays a result but I don't want it to be accessible by the user as in I don't want the keyboard to come up. How would I go about that in text?

  • Barrie Reader
    Barrie Reader about 14 years
    I included the "hidden" attribute for completeness' sake :)
  • LawVS
    LawVS about 14 years
    Cheers. I'll give it a go. :)