1. Basic Concepts
View: The parent of all visual controls, an object that the user can interact with on the Android app screen (for example, a button drop-down box text box, and so on).
A subclass of Viewgroup:view that holds the layout container for view and ViewGroup objects (linear layout, relative layout, and so on).
Simply understood, view is a variety of controls (buttons, text), and ViewGroup provides a variety of layout modes.
Any component in the app is a hierarchical structure that uses view and ViewGroup objects. For example, ViewGroup is used for the organization layout mode of the View object to which each view represents an input control or UI part.
2. Defining layouts
Method 1: Instantiate the View object in code and build the UI hierarchy tree;
Method 2: Use XML to compose the layout (reading habits, the most common way), the element name in the XML file represents view, so the <TextView> element creates the TextView control, <linearlayout > element to create a linearlayout container;
3. Common layout
- LinearLayout (Linear layout)
- Relativelayout (relative layout)
- Tablelayout (Table layout)
- Framelayout (Frame layout)
- Absolutelayout (Absolute layout)
- GridLayout (Grid layout)
4. Common Controls
- TextView (text box)
- EditText (input box)
- button (buttons) and ImageButton (image button)
- ImageView (Image view)
- RadioButton (radio button) &checkbox (check box)
- Switch button ToggleButton and switching switch
- ProgressBar (progress bar)
- SeekBar (drag bar)
- Ratingbar (star rating bar)
- ScrollView (scroll bar)
- Date&time components
Android UI View and ViewGroup