Android layout details (i)

Source: Internet
Author: User

Activity is the basic unit of Android apps. The activity shows the interactive interface such as keystrokes, text, and so on. The activity interface is defined in the corresponding. xml file for layout under RES and can be defined by modifying the. xml file.

Run yes, by calling Setconsentview () in Oncreat () to apply the appropriate interface.

Activities contain views and view groups, and views are widgets that can be displayed, such as keystrokes, text, and so on. View inheritance and Android.view.View. One or more views can form a view group. The view group provides a layout that inherits the view group from Android.view.ViewGroup.

The following layouts are commonly supported:

Linearlayout,absolutelayout,tablelayout,relativelayout,framelayout,scollview, etc.


Views and view groups have some common properties:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/59/C5/wKiom1TgHe2z147lAAIuJn1ed4Q352.jpg "title=" 1.png " alt= "Wkiom1tghe2z147laaiujn1ed4q352.jpg"/>

PS: Some properties can only be used in a specific layout

You can use constants to set certain properties, such as Fill_parent and wrap_content, which can be used to set the width and Height properties, which means that the fill is filled with the parent element and its size is its content size.


Supplement: 650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/59/C1/wKioL1TgIFLSap48AAHf1mFEMyo900.jpg "title=" 2. PNG "alt=" wkiol1tgiflsap48aahf1mfemyo900.jpg "/>

It is recommended to use DP as the unit, which masks the actual screen resolution, which is displayed at different resolutions.

This article is from the "Useless Uncle" blog, please be sure to keep this source http://aslonely.blog.51cto.com/6552465/1614556

Android layout details (i)

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.