Displays text to the user and optionally allows them to edit it. A TextView is a complete text editor, however the basic class is configured to not allow editing; see for a subclass that configures the text view for editing.
这是谷歌官方对于TextView的介绍:向用户显示文本,并允许用户编辑文本。TextView是一个完整的文本编辑器,但基类被配置为不允许编辑。
其在xml里面的基本使用:
在Android开发中,TextView是比较常用的控件,展示文本信息,其属性也是比较繁多的,可设置文字的字体大小、颜色、背景色、边距等基本样式。


TextView作为顶层View,可以算作一个大类,其继承了View,是Button、EditText等多个关键控件类的父类。
- Button:用户可以点击或单击以执行操作的用户界面元素。
- CheckedTextView:TextView支持Checkable界面和显示的扩展。
- Chronometer:实现简单计时器的类。
- DigitalClock:已弃用,可用TextClock替代。
- EditText:用于输入和修改文本的用户界面元素。
- TextClock:可以将当前日期或时间显示为格式化字符串,可以利用它显示实时刷新的当前时间。
版权声明:
本文来源网络,所有图片文章版权属于原作者,如有侵权,联系删除。
本文网址:https://www.mushiming.com/mjsbk/14383.html