I. Absolutelayout (absolute layout) Focus:
Absolutelayout (absolute layout) put this to the end, because the absolute layout, we are basically not used, we develop the application needs to be on a lot of models on a fit, if you use this absolute layout, you may be on the 4-inch phone is displayed normal, Instead of a 5-inch cell phone, it is possible to offset and deform, so it is not recommended to use the
Two. Absolutelayout (absolute layout) Common properties:
Control Size:
Android:layout_width: Component Width android:layout_height: component height
Control Position:
Android:layout_x: Sets the x-coordinate of the component android:layout_y: Sets the y-coordinate of the component
Three. Example (main rendering android:layout_x, Android:layout_y control control location)
1. First we create a absolutelayout XML file
The code is as follows:
1 <?XML version= "1.0" encoding= "Utf-8"?>2 <Absolutelayoutxmlns:android= "Http://schemas.android.com/apk/res/android"3 Android:layout_width= "Match_parent"4 Android:layout_height= "Match_parent" >5 6 <Button7 Android:id= "@+id/button1"8 Android:layout_width= "Wrap_content"9 Android:layout_height= "Wrap_content"Ten android:layout_x= "32DP" One android:layout_y= "53DP" A Android:text= "button" /> - - <Button the Android:id= "@+id/button2" - Android:layout_width= "Wrap_content" - Android:layout_height= "Wrap_content" - android:layout_x= "146DP" + android:layout_y= "53DP" - Android:text= "button" /> + A <Button at Android:id= "@+id/button3" - Android:layout_width= "Wrap_content" - Android:layout_height= "Wrap_content" - android:layout_x= "85DP" - android:layout_y= "135DP" - Android:text= "button" /> in - </Absolutelayout>
The results of the operation are as follows:
The above is my understanding of absolutelayout (absolute layout)
One of the five largest android layouts for absolute layout (absolutelayout)