文档详情

Android控件大全.pdf

发布:2017-09-14约22.79万字共110页下载文档
文本预览下载声明
Android 中常见控件的介绍和使用 1 TextView 文本框 1.1 TextView 类的结构 TextView 是用于显示字符串的组件,对于用户来说就是屏幕中一块用于显示文本的区域。TextView 类的层次关系如下: java.lang.Object ↳ android.view.View ↳ android.widget.TextView 直接子类: Button, CheckedTextView, Chronometer, DigitalClock, EditText 间接子类: AutoCompleteTextView, CheckBox, CompoundButton, ExtractEditText,MultiAutoCompleteTextView, RadioButton, ToggleBu tton 1.2 TextView 类的方法 主要方法 功能描述 返回值 TextView TextView 的构造方法 Null getDefaultMovementmethod 获取默认的箭头按键移动方式 Movementmethod getText 获得 TextView 对象的文本 CharSquence length 获得 TextView 中的文本长度 Int getEditableText 取得文本的可编辑对象,通过 这个对象可对 TextView 的文本进行操作,如 Void 在光标之后插入字符 getCompoundPaddingBottom 返回底部填充物 Int setCompoundDrawables 设置图像显示的位置,在 设置该 Drawable 资源之前需要调用 setBounds Void (Rect) setCompoundDrawablesWithIn 设置 Drawable 图像的显示位置,但其边界不变 Void trinsicBounds setPadding 根据位置设置填充物 Void getAutoLinkMask 返回自动连接的掩码 Void setTextColor 设置文本显示的颜色 Void setHighlightColor 设置文本选中时显示的颜色
显示全部
相似文档