View Overview
Most Android UI components are placed in the Android.view and Android.widght packages, while Android's UI components inherit the view class.
The view class also has a very important subclass: ViewGroup. ViewGroup inherits view, which is often used as a container for other components, and Android uses the combination mode for view and ViewGroup designs:
That is, ViewGroup belongs to the view class, so viewgroup can contain both the view class and the ViewGroup class.
Introduction to Layouts
Android provides two ways to draw UI components,
1. In the XML file, set the component through the XML attribute.
2. Set component properties in Java code through Java methods.
View common properties and methods introduction
View is the base class for the UI, so his property settings and methods, and other UI components can
ViewGroup Introduction
ViewGroup inherits the view, but it is often used as a container, because it is an abstraction, so it is often used as a container for its subclasses, such as the lattice card layout container.
The ViewGroup control subassembly relies on two two inner classes, Viewgroup.layoutparam and Viewgroup.marginlayoutparam.
Viewgroup.layoutparam the corresponding XML attribute is:
The viewgroup.marginlayoutparam corresponding XML attribute is
Android View class Introduction-android learning Journey (13)