UILabel UITextField UITextView

What is the fundamental difference between the two?

Is a UITextField not edited efficiently by UILabel ?

Are they essentially the same?

+68
cocoa-touch
May 18 '11 at 5:49
source share
5 answers
  • UILabel : "The UILabel class implements a read-only text view."
  • UITextField : "A UITextField is a control that displays editable text and sends an action message to the target when the user presses the back button."
  • UITextView : "The UITextView class implements behavior for a scrollable multi-line text area."

So:

  • read-only shortcuts
  • Text fields are editable and provide a horizontal search for characters (without actually scrolling) when the text is too long to be displayed simultaneously. Commonly used to enter short text.
  • Text views are also editable, but provide vertical scrolling when the text is too long to display all in one.
+116
May 18 '11 at 5:55 a.m.
source share

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

+25
Sep 30 '12 at 2:21
source share
  • UILabel - used for static text rendering,
  • UITextField - input field,
  • UITextView is a multi-line input field
+11
May 18 '11 at 5:57
source share

Finally, Apple revealed this part in this amazing presentation:

https://developer.apple.com/videos/play/wwdc2018/221/

The main techniques are as follows:

enter image description here

+2
Oct. 23 '18 at 17:24
source share

Also in addition to this: only with UILabel you can get the automatic shrink function, otherwise you must implement this (if necessary)

0
Jul 28 '16 at 21:53
source share



All Articles