Basic Design of Android-UI (User Interface)

Source: Internet
Author: User

Basic Design of the UI (User Interface)


Address: http://blog.csdn.net/caroline_wendy


UI (User Interface)IncludeFour TypesBasic elements,View),ViewGroup),Fragment),Activity);

View:Base classes of all visible interface elements;

ViewGroup:View class extension, including multiple sub-views and layout manager;

Fragment:Creates reusable la S and blocks the la; S;

Acitivity:You need to assign a View to the window or screen displayed to the user;


All visualization components are composedView classDerived from;

Allocate the user interface to the Activity and useSetContentView ()Can accept the ID (Resource) of a layout resource or an instance (new) of a separate view );

FindViewById (),Obtain the reference of each view in layout. You can find any child view of fragment from the parent activity;


Layout managerYesViewGroup classControls the position of child controls in the UI, including four common layout classes:

FrameLayout: Simple layout manager, directly stacked, the upper left corner by default, will generate a hidden;

LinearLayout: Vertical or horizontal layout management;

RelativeLayout:Between each subview and other views and the relative position of the screen;

GridLayout:Grid view, nesting various views and la S;


You can add controlsNestingAdjust parameters in the view;

Wrap_content:Minimum Size of the contained content, wrap (surrounded );

Match_parent:Fill in the parent class view;


You can also useCodeImplement layout;



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.