When you use the android interface development tool droiddraw, you will find that its default layout is absolute layout, that is, using coordinates to specify the location of each control, this method is more convenient when you drag controls directly, but it is not conduciveProgramSo we recommend that you do not use absolute layout. The following program is a logon interface with an absolute layout. It is very easy to paste the XML file.
<? XML version = "1.0" encoding = "UTF-8"?> <Absolutelayout xmlns: Android = "http://schemas.android.com/apk/res/android" Android: Orientation = "vertical" Android: layout_width = "fill_parent" Android: layout_height = "fill_parent"> <! -- Define a text box and use absolute positioning --> <textview Android: layout_x = "20dip" Android: layout_y = "20dip" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" Android: text = "username:"/> <! -- Define a text editing box and use absolute positioning --> <edittext Android: layout_x = "80dip" Android: layout_y = "15dip" Android: layout_width = "wrap_content" Android: width = "200px" Android: layout_height = "wrap_content"/> <! -- Define a text box and use absolute positioning --> <textview Android: layout_x = "20dip" Android: layout_y = "80dip" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" Android: text = "Password:"/> <! -- Define a text editing box and use absolute positioning --> <edittext Android: layout_x = "80dip" Android: layout_y = "75dip" Android: layout_width = "wrap_content" Android: width = "200px" Android: layout_height = "wrap_content" Android: Password = "true"/> <! -- Define a button and use absolute positioning --> <button Android: layout_x = "130dip" Android: layout_y = "135dip" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" Android: text = ""/> </absolutelayout>