Let me introduce you to the simple text today.
First, let's look at the inheritance of TextView and some basic properties:
The XML file is as follows:
<?xml version= "1.0" encoding= "Utf-8"? ><linearlayout xmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"android:orientation= "Vertical"android:padding= "5DP" ><!--Text--<!--Android:gravity the internal alignment of the control android:layout_gravity the alignment of the control itself relative to the parent-<TextView android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"android:gravity= "Center"Android:paddingtop= "20DP"Android:text= "Introduce Yourself"Android:textcolor= "@color/red"android:textsize= "35sp"/> <TextView android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:background= "#CD3700"Android:text= "Name: Zhang Sanfeng"android:textsize= "25SP"Android:textstyle= "Italic"/> <TextView android:layout_width= "160DP"Android:layout_height= "Wrap_content"Android:background= "@color/purple"Android:text= "Age: 110"android:textsize= "25sp"/> <TextView android:layout_width= "240DP"Android:layout_height= "80DP"Android:layout_marginleft= "20DP"Android:background= "@color/blue"android:gravity= "Center_vertical"Android:text= "Graduation School: Shaolin Temple"android:textsize= "25sp"/> <TextView android:layout_width= "Match_parent"Android:layout_height= "80DP"Android:background= "@color/green"android:gravity= "Center_horizontal"Android:text= "Work unit: Wudang"android:textsize= "25SP"/><!--Autolink property, automatically identify the connection phone, URL, etc.-<TextView android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:autolink= "All"Android:text= "Self-Introduction: My Phone is 13988888888,email is [email protected], personal URL is http://www.baidu.com"/> <TextView android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:singleline= "true"Android:text= "Hello everyone, I am xxx, today's mood is very depressed, why?" I don't know ... "/> <TextView android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"android:layout_gravity= "Center"Android:textstyle= "Bold"Android:inputtype= "Textpassword"//set to password mode, it becomes a point.Android:text= "See where I Am"/></linearlayout>
As follows:
Text (TextView)