Android study notes 5: absolute Layout

Source: Internet
Author: User

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.