android学习笔记17:文字设置
16lz
2021-01-23
在Android文字可以设置的属性包括大小,颜色,是否是密码,是否显示阴影,超链接,文字无法显示的时候的省略规则等。
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:orientation="vertical"android:layout_width="fill_parent"android:layout_height="fill_parent"><!-- 设置字体为20pt --><TextViewandroid:layout_width="fill_parent" android:layout_height="wrap_content" android:text="我爱yanzi"android:textSize="20pt"/><!-- 设置中间省略 --><TextViewandroid:layout_width="fill_parent" android:layout_height="wrap_content"android:singleLine="true" android:text="我爱yanzi我爱yanzi我爱yanzi我爱yanzi我爱yanzi我aaayanzi"android:ellipsize="middle"/><!-- 对网址增加链接 --><TextViewandroid:layout_width="fill_parent" android:layout_height="wrap_content"android:singleLine="true" android:text="测试http://blog.csdn.net/hn307165411内容"android:autoLink="all"/><!-- 设置文字颜色 、大小,并使用阴影 --><TextViewandroid:layout_width="fill_parent" android:layout_height="wrap_content" android:text="测试文字"android:shadowColor="#0000ff"android:shadowDx="15.0"android:shadowDy="20.0"android:shadowRadius="45.0"android:textColor="#ff0000"android:textSize="25pt"/><!-- 测试密码框 --><TextView android:id="@+id/passwd"android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello"android:password="true"/></LinearLayout>
更多相关文章
- android自动化测试工具---monkeyrunner工具
- android去掉layout顶部的阴影(状态栏下边的阴影)
- android 8.1 vts环境和测试
- [Android]再简单解释一下androidtest包下的其他测试类
- Android中TextView 添加ClickableSpan后点击选中文字背景变色问
- Android阴影
- android PopupWindow 阴影背景 、动画 、点击显示、隐藏
- Android CTS测试Fail项修改总结(四)
- Android测试总结