This example describes the Absolutelayout usage of the Android programming layout (Layout). Share to everyone for your reference, specific as follows:
Absolutelayout, as the name suggests, is the absolute position of the layout, can also be called the coordinate layout, that is, the absolute position of the specified element (or the absolute value of the coordinates). This layout is simple and direct, intuitive, but because the screen size of the mobile phone is relatively large, the use of absolute positioning is relatively poor adaptability.
<?xml Version = "1.0" encoding = "Utf-8"?> <absolutelayout xmlns:android= "http://"
Schemas.android.com/apk/res/android "android:layout_width=" fill_parent "android:layout_height=" Wrap_content " android:padding= "10dip" > <textview android:id= "@+id/lable" android:layout_width= "Fill_parent" android:layout _height= "wrap_content" android:text= "Please enter the username:"/> <edittext android:id= "@+id/text" android:layout_width= "Fill_ Parent "android:layout_height=" wrap_content "android:layout_x=" 100dip "android:layout_y=" 20dip "/> <button Android:id= "@+id/cancel" android:layout_width= "wrap_content" android:layout_height= "Wrap_content" Android:layout_ x= "10dip" android:layout_y= "50dip" android:text= "Cancel"/> <button android:id= "@+id/ok" android:layout_width= " Wrap_content "android:layout_height=" wrap_content "android:layout_x=" 60dip "android:layout_y=" 50dip "android:t ext= "OK"/> </absolutelayout>
The effect is as follows:
If you do not specify layout_x and layout_y, the default is 0. The back is displayed in the upper-left corner.
I hope this article will help you with the Android program.