One of the five largest android layouts for absolute layout (absolutelayout)

Source: Internet
Author: User

I. Absolutelayout (absolute layout) Focus:

Absolutelayout (absolute layout) put this to the end, because the absolute layout, we are basically not used, we develop the application needs to be on a lot of models on a fit, if you use this absolute layout, you may be on the 4-inch phone is displayed normal, Instead of a 5-inch cell phone, it is possible to offset and deform, so it is not recommended to use the

Two. Absolutelayout (absolute layout) Common properties:

Control Size:

Android:layout_width: Component Width android:layout_height: component height

Control Position:
Android:layout_x: Sets the x-coordinate of the component android:layout_y: Sets the y-coordinate of the component

Three. Example (main rendering android:layout_x, Android:layout_y control control location)

1. First we create a absolutelayout XML file

The code is as follows:

1 <?XML version= "1.0" encoding= "Utf-8"?>2 <Absolutelayoutxmlns:android= "Http://schemas.android.com/apk/res/android"3 Android:layout_width= "Match_parent"4 Android:layout_height= "Match_parent" >5 6     <Button7         Android:id= "@+id/button1"8 Android:layout_width= "Wrap_content"9 Android:layout_height= "Wrap_content"Ten android:layout_x= "32DP" One android:layout_y= "53DP" A Android:text= "button" /> -  -     <Button the         Android:id= "@+id/button2" - Android:layout_width= "Wrap_content" - Android:layout_height= "Wrap_content" - android:layout_x= "146DP" + android:layout_y= "53DP" - Android:text= "button" /> +  A     <Button at         Android:id= "@+id/button3" - Android:layout_width= "Wrap_content" - Android:layout_height= "Wrap_content" - android:layout_x= "85DP" - android:layout_y= "135DP" - Android:text= "button" /> in  - </Absolutelayout>

The results of the operation are as follows:

The above is my understanding of absolutelayout (absolute layout)

One of the five largest android layouts for absolute layout (absolutelayout)

Related Article

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.