1. Introduction
Android controls are mostly located in Android.widget, Android.view.View for their parent class
For dialog series, Android.app.Dialog is the parent class
Native controls for Android, typically declared in an XML file under Res/layout
Then the activity is loaded by using Super.setcontentview (r.layout.layout_name) to load the layout
Gets a reference to the control in activity using Super.findviewbyid (R.ID.WIDGET_ID), which can then be used to manipulate the control (adding listening, setting content).
It is worth proposing that the layout of the previous article (LinearLayout, Tablelayout, Relativelayout, ...) are all controls.
2. Control diagram
View sub-class structure diagram:
TextView sub-class structure:
ViewGroup sub-class structure diagram:
Framelayout sub-class structure:
Android.app.Dialog sub-class structure:
3. Basic control Introduction 3.1 Text class control
Common text class controls are as follows:
TextView is responsible for displaying text, non-editable edittext editable text controls
3.2 Button Class control
Button ImageButton Picture button
ToggleButton switch button radiobutton/radiogroup radio button checkbox check button
3.3 Picture class controls
ImageView is responsible for displaying pictures
3.4 Progress bar control
ProgressBar Show progress bar, do not drag seekbar drag bar ratingbar star rating Bar
3.5 Time Class Control
Textclock Text clock analogclock analog clock chronometer timer datepicker date selector Timepicker Time Picker CalendarView Date View
3.6 Tips & Dialog box controls
Toast message Tip box notification status Bar Notification alertdialog dialog box ProgressDialog progress Bar dialog box
4. Layout class Control 4.1 Basic Layout class control
For more information refer to <activity layout >
4.2 Adapter Layout class controls
This type of control requires adapter (Baseadapter, Arrayadapter, Simpleadapter) to work with
ListView List View Expandablelistview collapsible list GridView grid view spinner list options box Viewflipper Flip View Gallery Gallery View
4.3 Scroll bar controls
ScrollView a scrollable layout container
Reference:
<android Notes---Common Controls and Usage >
<android Development Learning, basic interface Controls >
Introduction to Android Controls