textView 属性总结

本文详细总结了Android中TextView的重要属性,包括其在XML布局文件中的用法,字符串操作,浮点数显示,以及如何处理电话链接等。
摘要由CSDN通过智能技术生成

XML 属性
属性名 相关方法 描述
android:autoLink setAutoLinkMask(int) 控制是否自动查找并转换 URL、邮箱地址等链接为可点击链接.默认值为"none",禁止该属性.
android:autoText setKeyListener(KeyListener) 如果设置,这表示该 TextView 的文本输入法可以自动更正常见拼写错误.
android:bufferType setText(CharSequence,TextView.BufferType) 决定 getText() 方法返回值的种类.默认值为 "normal".注意,EditText 和 LogTextBox 总是返回 Editable,及时你指定更低的基本也无济于事.
android:capitalize setKeyListener(KeyListener) 如果设置该属性,则指定该 TextView 的文本输入法可以自动改变用户输入的字母为大写.
android:cursorVisible setCursorVisible(boolean) 使光标可见(默认)或隐藏.
android:digits setKeyListener(KeyListener) 如果设置,则指定该 TextView 使用数字输入法,只接受指定的字符.
android:drawableBottom setCompoundDrawablesWithIntrinsicBounds(int,int,int,int) 在文本下方显示可绘制对象.
android:drawableLeft setCompoundDrawablesWithIntrinsicBounds(int,int,int,int) 在文本左侧显示可绘制对象.
android:drawablePadding setCompoundDrawablePadding(int) 文本和可绘制对象的间距.
android:drawableRight setCompoundDrawablesWithIntrinsicBounds(int,int,int,int) 在文本右侧显示可绘制对象.
android:drawableTop setCompoundDrawablesWithIntrinsicBounds(int,int,int,int) 在文本上方显示可绘制对象.
android:editable   如果设置,则指定该 Te
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值