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;