---restore content starts---
1. Create Android Project
2.TextView Text color settings
<?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"
>
<textview
Android:id= "@+id/mytext1"
Android:layout_width= "Fill_parent"
android:layout_height= "Wrap_content"
android:textcolor= "#ffff00"
android:text= "@string/hello"
/>
</LinearLayout>
Run the following effect
3.TextView Text Size setting
<?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"
>
<textview
Android:id= "@+id/mytext1"
Android:layout_width= "Fill_parent"
android:layout_height= "Wrap_content"
Android:textcolor= "#ffff00"
android:textsize= "22px"
android:text= "@string/hello"
/>
</LinearLayout>
Run the following effect
4.TextView up and down distance settings
<textview
Android:id= "@+id/mytext2"
Android:layout_width= "Fill_parent"
android:layout_height= "Wrap_content"
Android:layout_margin= "30px"
android:text= "url: www.baidu.com"/>
Run the following effect
5.TextView distance from top
<textview
Android:id= "@+id/mytext3"
Android:layout_width= "Fill_parent"
android:layout_height= "Wrap_content"
android:layout_margintop= "10px"
android:maxlength= "3" >(up to 3 words)
android:text= "Abababababababa"/>
Run the following effect
Text display on a 6.TextView background
<textview
Android:id= "@+id/mytext4"
Android:layout_width= "Fill_parent"
android:layout_height= "Wrap_content"
android:background= "@drawable/log" (background image)
Android:textstyle= "Bold" (text bold)
Android:text= "This is the text on the background image"/>
Run the following effect
7.TextView URL Link
<textview
Android:id= "@+id/mytext5"
Android:layout_width= "Fill_parent"
android:layout_height= "Wrap_content"
Android:textcolor= "#000000"
Android:textsize= "36PX"
android:autolink= "All"
android:text= "url: www.baidu.com"/>
Run the following effect
8. Use style sheets to define common component properties for easy maintenance
<?xml version= "1.0" encoding= "Utf-8"?>
<resources>
<style name= "style_msg" >
<item name= "Android:layout_width" >fill_parent</item>
<item name= "Android:layout_height" >wrap_content</item>
<item name= "Android:textcolor" > #000000 </item>
<item name= "android:textsize" >36px</item>
<item name= "Android:autolink" >all</item>
</style>
</resources>
Note: This file is placed in the values directory
Main.xml Use the following
<textview
Android:id= "@+id/mytext5"
style= "@style/style_msg"
android:text= "url: www.baidu.com"/>
Run the following effect
Android-textview (Text display component 2)