1.Activity Common methods
View Findviewbyid (int id)//Get Component Object based on component ID
Setcontentview (int layoutresid)//Set layout file, set display component
2.TextView
Android:maxlength= "6"//maximum number of characters allowed
Android:textcolor= "#FF0000"//Color of text
Android:textsize= "50px"//Size of text
Android:textstyle= "Bold"//Text style
Android:password= "true"//whether it is displayed in ciphertext mode
android:layout_margin= "50px"//Margin
android:background= "@drawable/P"//Background
android= value of "@+id/id value"//Setting ID
GetText (). toString ();//Get the text content of the control
SetText ();//Set the text content of the control
Note:<!----;: Notes
3.Button
4.EditText
Android:enabled= "false"//setting is available, false not used
<?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/tv"Android:layout_width="fill_parent"Android:layout_height="wrap_content"Android:text="Second123"Android:maxlength="6"Android:textcolor="#FF0000"android:textsize="50px"Android:textstyle="Bold"Android:password="true"Android:layout_margin="50px"Android:background="@drawable/P"/>-<!--prefix: prefix--<TextView Android="@+id/tv2"Android:layout_width="fill_parent"Android:layout_height="wrap_content"Android:text="Second123"Android:maxlength="9"Android:textcolor="#00FF00"android:textsize="50px"Android:textstyle="Bold"Android:password="true"/><Button android:layout_width="fill_parent"Android:layout_height="wrap_content"Android:text="Button"Android:textcolor="#FF0000"/><EditText android:layout_width="fill_parent"Android:layout_height="wrap_content"Android:text="I'm a good guy ."android:enabled="false"/></linearlayout>
Sample Code
Some methods and properties of Android