View, viewgroup, widget, and linearlayout)

Source: Internet
Author: User

Basic basic knowledge of the entry level. Previously, the relationship between views, viewgroup, widgets, and layout was unclear. After learning, I made a summary as follows:

1. View, viewgroup

> View:

} 1. All advanced UI components are implemented by inheriting the View class.} 2. A view occupies a rectangular area on the screen.} 3. Rendering. 4. Processing events} 5. Set whether to be visible} 6. Set whether to obtain the focus. 2. viewgroup:} 1. A viewgroup object is Android. view. viewgroup instance} 2. View container} 3. layout of views added to viewgroup} 4. One viewgroup can be added to another viewgroup 3. relationship between views and viewgroups

4. inheritance relationship of view and widgetview

2. Widgets

} 1. Various widgets displayed on the Interface} 2. Independent Event processing capability} 3. All the components of the wiget are inherited from the view. Note: 1. widgets are not actually existing classes, they are a package, and views are actually existing classes, so the first letter is capitalized. When referencing, usually:

Import Android. View. view;

Import Android. widget. textview;

Because widgets are packages, the first letter is lowercase.

2. The package contains UI elements, including textview and listview, but these elements are inherited from view or viewgroup. As shown in:

 

 

 

Various layout values are inherited from viewgroup.

4 Layout

Layout UI Components

The relationship between view and its subclass is as follows:

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.