Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UILabel UITextField UITextView

Tags:

cocoa-touch

What's the fundamental difference between them?

Is a UITextField that's not editable is effectively a UILabel?

Are those essentially the same?

like image 847
user4951 Avatar asked May 18 '11 05:05

user4951


People also ask

What is difference between textView and textfield?

textfields are editable, and provide horizontal character seeking (not really scrolling) when the text is too long to display all at once. Generally used to input short text. textviews are also editable, but provide vertical scrolling when the text is too long to display all at one.


2 Answers

  • UILabel: "The UILabel class implements a read-only text view."
  • UITextField: "A UITextField object is a control that displays editable text and sends an action message to a target object when the user presses the return button."
  • UITextView: "The UITextView class implements the behavior for a scrollable, multiline text region."

So:

  • labels are read-only
  • textfields are editable, and provide horizontal character seeking (not really scrolling) when the text is too long to display all at once. Generally used to input short text.
  • textviews are also editable, but provide vertical scrolling when the text is too long to display all at one.
like image 83
Dave DeLong Avatar answered Nov 23 '22 11:11

Dave DeLong


In addition to the above answers, UITextView has selectable text. This means that you can copy it or get the device to speak the text.

like image 39
Amory Avatar answered Nov 23 '22 10:11

Amory