1. Memorize words
title-Title
Finish-completed
format-formatting
layout-layout
window-window
graphical-graphical
edittext-editing text
linearlayout-Linear layout
vertical-Vertical
horizontal-Landscape
width-width
height-High
Layout: is a container.
LinearLayout: Has two directions, one is landscape and the other is portrait.
Label:< These two brackets are the label, the tag can have a lot of properties, if you do not specify a specific property value, the system will use the default value, different labels may have different properties, the label has the start tag < tag name > and end tag </tag name, or is < Tag name/>.
TextView: Text label
EditText: Editing Text labels
Button: Buttons tab
Properties: Most tags require android:layout_width and Android:layout_height properties.
Android:layout_width: The width of the control
Android:layout_height: The height of the control
Android:text: Text displayed by the control
Android:layout_gravity: Defining the location of child controls in a parent control
Android:gravity: Defines the position of the contents of the control in the control
Android:layout_margin: The control's uniform distance from other controls, including parent and sibling controls.
Android:layout_marginleft: Left margin of control
Android:layout_marginright: Right margin of control
Android:layout_margintop: Top margin of control
Android:layout_marginbottom: Bottom margin of control
Android:inputtype: is an attribute in the EditText tag that controls the type of input content, such as the value of a password's attribute is Textpassword.
Android:hint: is a property in the EditText tag that prompts the user for input
Android:textcolor: Defines the font color, the value of which is a hexadecimal value of three primary colors. The format has #rgb or #rrggbb, etc. R means red (red), G refers to green (green), and B refers to Blue (blue). FFFFFF or FFF is white, 0000ff or 00f is blue, 000000 is or 000 black, eeeeee or Eee is gray.
Android:background: Defines the background of the control, either as a picture or as a color.
Such as: The following two ways the same effect
1 <TextView 2 android:layout_width= "Wrap_content" 3 android:layout _height= "Wrap_content" 4 5 android:layout_gravity= "center" 6 /> 7 8 <TextView 9 android:layout_width= "match_parent" Android:layout_ height= "Wrap_content" android:gravity= "center" />
View Code
XML file Comment:<!--to comment--the shortcut key is shift+ctrl+/.
Code:
1 <LinearLayoutxmlns:android= "Http://schemas.android.com/apk/res/android"2 Android:layout_width= "Fill_parent"3 Android:layout_height= "Fill_parent"4 android:orientation= "vertical" >5 6 <TextView7 Android:layout_width= "Wrap_content"8 Android:layout_height= "Wrap_content"9 android:layout_gravity= "Center"Ten Android:text= "Driver Login" /> One A <EditText - Android:layout_width= "Match_parent" - Android:layout_height= "Wrap_content" the Android:layout_marginleft= "20DP" - Android:layout_marginright= "20DP" - Android:layout_margintop= "20DP" - Android:background= "#fff" + Android:hint= "mobile number" /> - + <EditText A Android:layout_width= "Match_parent" at Android:layout_height= "Wrap_content" - Android:layout_marginleft= "20DP" - Android:layout_marginright= "20DP" - Android:layout_margintop= "20DP" - Android:background= "#fff" - Android:hint= "Password" in Android:inputtype= "Textpassword" /> - to <Button + Android:layout_width= "Match_parent" - Android:layout_height= "Wrap_content" the Android:layout_marginleft= "20DP" * Android:layout_marginright= "20DP" $ Android:layout_margintop= "20DP"Panax Notoginseng Android:background= "#00f" - Android:text= "Login" the Android:textcolor= "#ffffff" /> + A </LinearLayout>
View Code
3.21-Login Screen