Introduction to Android Controls

Source: Internet
Author: User

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

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.