Android7.0中文文档(API)-- TextView

来源:互联网 发布:js点击按钮隐藏div 编辑:程序博客网 时间:2024/06/09 01:21

完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/TextView.html

TextView

public class TextView
extends View implements ViewTreeObserver.OnPreDrawListener

java.lang.Object   ↳android.view.View    ↳android.widget.TextView
已知的直接子类
已知的间接子类


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; seeEditText for a subclass that configures the text view for editing.
向用户显示文本,并且可以选择允许用户编辑它。TextView是一个完整的文本编辑器,但是基类被配置成不可编辑的;请参考EditText子类,它被配置成可编辑的文本视图。

To allow users to copy some or all of the TextView's value and paste it somewhere else, set the XML attributeandroid:textIsSelectable to "true" or callsetTextIsSelectable(true). ThetextIsSelectable flag allows users to make selection gestures in the TextView, which in turn triggers the system's built-in copy/paste controls.
为了允许用户复制部分或全部TextView的内容并将其粘贴到其他地方,可以设置XML属性android:textIsSelectable为true或调用setTextIsSelectable(true)textIsSelectable表示允许用户在TextView中做出手势,这将会触发系统内置的复制/粘贴操作。

XML attributes
XML属性

See TextView Attributes,View Attributes
参考TextView AttributesView Attributes

摘要


嵌套类

enumTextView.BufferType

Type of the text buffer that defines the characteristics of the text such as static, styleable, or editable. 
文本缓冲区的类型,它定义了文本的特征,如静态的,可样式化的或可编辑的。 

interfaceTextView.OnEditorActionListener

Interface definition for a callback to be invoked when an action is performed on the editor. 
回调的接口定义,当在编辑器上执行操作时调用。 

classTextView.SavedState

User interface state that is stored by TextView for implementing onSaveInstanceState()
由TextView存储的用户接口状态,用于onSaveInstanceState()的实现。 

XML属性

android:autoLink控制是否自动找到url和电子邮件地址等链接,并转换为可点击的链接。 android:autoSizeMaxTextSizeauto-sizing文本,使用的最大文本长度限制。

May be a dimension value, which is a floating point number appended with a unit such as "14.5sp". 
尺寸,带单位的一个浮点数,例如:14.5sp。 

原创粉丝点击