Android interface Layout

Source: Internet
Author: User

 

AndroidThe mobile phone operating system needs to write and implement various functions in the simulator. More prominent in interface operations

The andorid interface needs to be written in the XML of RES/layout. Generally, an XML corresponds to an interface.

The layout of the android interface is similar to HTML (including code annotation). The step is to first customize the android framework and put controls in the framework.

Framework provided by Android: absolutelayout

Linearlayout

Relativelayout

Tablelayout

Framelayout

Framelayout: there is only one control in it, and the position of the control cannot be designed. The control is placed in the upper left corner.

Linearlayout: Multiple controls can be placed, but only one control can be placed in one row.

Tablelayout: this should be used with tablerow, much like the table in HTML

Absolutelayout

Relativelayout: Multiple controls can be placed in the control, but the control positions are relative positions.

(The layout of the android interface seems to be able to directly reference some views, such as scrollview)

The XML of the Framework is as follows:

1. Android: Id = "@ + ID/widget36"

2. Android: layout_width = "fill_parent"

3. Android: layout_height = "fill_parent"

CodeAndroid: Indicates the property of the Control. fill_parent indicates the maximum width or height. wrap_content indicates the proper width or height.

Divided by three attributes, for example, Android: Background = "# ff0000ff", set the background color of the Framework, androidrientation = "vertical" to set the attributes of the framework content.

 

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.