<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="com.toby.personal.datatypeconverttest.MainActivity"
android:orientation="vertical">
<!--设置字号为20pt,文本框结尾处绘制图片-->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/test"
android:textSize="20pt"
android:drawableEnd="@mipmap/ic_launcher" />
<!--设置中间省略,所有字母大写-->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:text="@string/ellipsize"
android:ellipsize="middle"
android:textAllCaps="true" />
<!--对邮件、电话增加链接-->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:text="my email: my_mail@mail.com, my phone: 0108888888"
android:autoLink="email|phone" />
<!--设置文字颜色、大小,使用阴影-->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/test"
android:shadowColor="@color/colorAccent"
android:shadowDx="10.0"
android:shadowDy="8.0"
android:shadowRadius="3.0"
android:textColor="@color/colorPrimary"
android:textSize="18pt" />
<!--可勾选的文本-->
<CheckedTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/checkedText"
android:checkMark="@mipmap/ic_launcher"/>
</LinearLayout>