UILabel UITextField UITextView [英] UILabel UITextField UITextView

查看:48
本文介绍了UILabel UITextField UITextView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它们之间的根本区别是什么?

What's the fundamental difference between them?

不是可编辑的 UITextField 实际上是 UILabel

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

这些基本相同吗?

推荐答案


  • UILabel UILabel 类实现了只读文本视图。

  • < a href = https://developer.apple.com/documentation/uikit/uitextfield rel = nofollow noreferrer> UITextField : A UITextField 对象是一个控件,该控件显示可编辑的文本,并在用户按下返回按钮时将操作消息发送到目标对象。

  • < a href = https://developer.apple.com/documentation/uikit/uitextview rel = nofollow noreferrer> UITextView : < c $ c> UITextView 类可实现可滚动的多行文本区域的行为。

    • 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."
    • 所以:


      • 标签是只读的

      • 文本字段是可编辑的,当文本太长而无法一次全部显示时,它们可以提供水平字符查找(不是真正的滚动)。通常用于输入短文本。

      • 文本视图也是可编辑的,但是当文本太长而无法一次全部显示时,可以提供垂直滚动。

      这篇关于UILabel UITextField UITextView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆