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: