The absolute layout absolutelayout is similar to the layout of WinForm in. NET, with the upper-left corner of the form as the coordinate point and the right-down extension. Because the position of each control in the absolute layout is fixed and cannot be changed as the size of the screen changes, So the effect of running on different devices is different, so this kind of layout is used relatively little.
The controls in absolute layout absolutelayout have two important properties layout_x and layout_y are used to set the absolute position of the control, respectively.
Let's look at the effect of this example layout
<?xml version= "1.0" encoding= "Utf-8"? ><absolutelayout xmlns:android= "http://schemas.android.com/apk/res/ Android "Android:layout_width=" Match_parent "android:layout_height=" match_parent "> <imageview Andro Id:id= "@+id/imageview1" android:layout_width= "96DP" android:layout_height= "96DP" android:layout_x= "0d P "android:layout_y=" 3DP "android:src=" @raw/pad "/> <textview android:id=" @+id/textview2 " Android:layout_width= "120DP" android:layout_height= "wrap_content" android:layout_x= "110DP" Andro Id:layout_y= "78DP" android:text= "Product color: White"/> <textview android:id= "@+id/textview2" android:l Ayout_width= "120DP" android:layout_height= "wrap_content" android:layout_x= "110DP" android:layout_y= "4 7DP "android:text=" Product Price: $19 "/> <textview android:layout_width=" 120DP "android:layout_height = "Wrap_content" Android:layout_x= "110DP" android:layout_y= "16DP" android:text= "Product Name: Ipad Air"/> <textview android:id= "@+id/textview1" android:layout_width= "match_parent" android:layout_height= "3DP" android:layout_x= "0d P "android:layout_y=" 118DP "android:background=" #EEE8CD "android:text=" "/> <imageview Android:id= "@+id/imageview01" android:layout_width= "96DP" android:layout_height= "96DP" Android:layo ut_x= "9DP" android:layout_y= "137DP" android:src= "@raw/pad"/> <textview android:layout_width = "120DP" android:layout_height= "wrap_content" android:layout_x= "118DP" android:layout_y= "144DP" android:text= "Product Name: Ipad Air"/> <textview android:id= "@+id/textview01" android:layout_width= "120d P "android:layout_height=" Wrap_content "android:layout_x=" 118DP "android:layout_y=" 206DP "Android oid:text= "Product color: White"/> <textview android:id= "@+id/textview01" android:layout_width= "120DP" android:layout_height= "Wra P_content "android:layout_x=" 118DP "android:layout_y=" 176DP "android:text=" Product Price: $19 "/> <tex TView android:id= "@+id/textview02" android:layout_width= "match_parent" android:layout_height= "3DP" android:layout_x= "2DP" android:layout_y= "261DP" android:background= "#EEE8CD"/></ABSOLUTELAYOUT&G T
. NET programmer play to Android development---(9) Absolute Layout absolutelayout