Android7.0中文文档 --- EditText

本文详细介绍了Android中的EditText组件,它是TextView的一种可编辑形式,并列举了其直接和间接子类。此外,还提供了构造方法和一些公共方法的说明,如设置文本、获取文本等。

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

EditText

public class EditText
extends TextView

java.lang.Object
   ↳android.view.View
    ↳android.widget.TextView
     ↳android.widget.EditText


EditText is a thin veneer over TextView that configures itself to be editable.
EditText是在TextView基础上的一层薄薄的封装,TextView自身也可以配置成可编辑的。

See the Text Fields guide.
请参考Text Fields指南。

This widget does not support auto-sizing text.
此控件不支持对文本自适应(auto-sizing)。

XML attributes
XML属性

See EditText Attributes, TextView Attributes, View Attributes
请参考EditText AttributesTextView AttributesView Attributes

摘要


继承XML属性

From class android.widget.TextView
From class android.view.View

继承常量

From class android.widget.TextView
From class android.view.View

继承字段

From class android.view.View

Public构造方法

EditText(Context context)
EditText(Context context, AttributeSet attrs)
EditText(Context context, AttributeSet attrs, int defStyleAttr)
EditText(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public方法

voidextendSelection(int index)

Convenience for extendSelection(Spannable, int).
简化调用extendSelection(Spannable, int)

CharSequencegetAccessibilityClassName()

Return the class name of this object to be used for accessibility purposes.
返回此对象的类名,用于辅助功能目的。

booleangetFreezesText()

Return whether this text view is including its entire text contents in frozen icicles.
返回此文本视图是否包含冻结状态的整个文本内容。

EditablegetText()

Return the text that TextView is displaying.
返回TextView中显示的文本。

voidselectAll()

Convenience for selectAll(Spannable).
简化调用selectAll(Spannable)

voidsetEllipsize(TextUtils.TruncateAt ellipsis)

Causes words in the text that are longer than the view's width to be ellipsized instead of broken in the middle.
在文本中产生比视图宽度更长的文字,而不是在中间被打断。

voidsetSelection(int start, int stop)

Convenience for setSelection(Spannable, int, int).
简化调用setSelection(Spannable, int, int)

voidsetSelection(int index)

Convenience for setSelection(Spannable, int).
简化调用setSelection(Spannable, int)

voidsetText(CharSequence text, TextView.BufferType type)

Sets the text to be displayed and the TextView.BufferType.
设置要显示的文本和TextView.BufferType

保护方法

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值