(ii) Android basic controls

Source: Internet
Author: User
First section: View View components

The view view component in Andorid, the implementation class is the Android.view.View class, is the parent class of most graphical display classes, and provides a number of methods and properties. Under the view class, there are many subclasses, such as the text component class, the edit box component class, the Button component class and so on, for the developer to use; The implementation class of the view subclass, under the Android.widget package.

Section II: TextView text components

TextView Component main function is to display the text;

Linear layout: LinearLayout The default is the horizontal direction horizontal we can set the vertical direction of the linear layout vertical

Layout_width, layout_height settings

Wrap_content package content, content, width or length of how large;

Match_parent fills the parent container; If the top layout or control is match_parent, it will be forced to fill the screen.

Fill_parent and match_parent like Android2.2 in Match_parent and fill_parent is a meaning. Two parameters meaning, match_parent more appropriate, so from 2.2 onwards two words can be used. That

If you consider the use of a lower version, you need to use fill_parent.

DP px SP

px pixels
DP does not depend on pixels
The SP is not scaled-independent abstract pixels (scale-independent Pixel). The SP and DP are similar but the only difference is that the Android system allows
User-defined text size (small, normal, large, oversized, etc.)

(ii) Android basic controls

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.