Android API Demos Learning (1)-Hello World

Source: Internet
Author: User

The Hello World example is an example of a basic screen display Activity. Mainly XML:
 
1. <TextView xmlns: android = "http://schemas.android.com/apk/res/android" android: id = "@ + id/text"
2. android: layout_width = "match_parent" android: layout_height = "match_parent"
3. android: gravity = "center_vertical | center_horizontal"
4. android: text = "@ string/hello_world"/>
 
• Contains a simple TextView.
• Android: layout_width defines the www.2cto.com width of the element. match_parent indicates filling the width of the previous layer as much as possible, and wrap_content indicates the width of the adaptive element, that is, when the element content is too wide, it is too wide; layout_height is similar.
• Android: gravity defines the alignment of elements, which are horizontally centered and vertically centered.



From Xiao He's exposure to sharp corners
 

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.