view是Android中所有控件的基类,不管是button,还是Text View,或复杂的布局RelativeLayout和ListView,它们的基类,都是View,它是界面层控件的一个抽象。通过VIewGroup可以看出,ViewGroup中含有多个View,但它也是继承自View,所以,View可以是一个单独的控件,也可以是多个控件组成的一组控件。
View的继承关系如下,其中第一列直接继承View类:
TextView 文本框 | EditText 文本输入编辑框 | ExtractEditText | ||
AutoCompleteTextView | AppCompatAutoCompleteTextView | SearchAutoComplete | ||
AppCompatEditText | TextInputEditText | |||
Button 按钮 | CompoundButton | Switch 开关控件 | ||
CheckBox 复选框 | AppCompatCheckBox | |||
RadioButton | AppCompatRadioButton | |||
SwitchCompat | ||||
ToggleButton | ||||
AppCompatButton | ||||
CheckedTextView | AppCompatCheckedTextView | |||
AppCompatTextView | ActionMenuItemView | |||
DigitalClock | ||||
DialogTitle | ||||
TextClock | ||||
Chronometer | ||||
ImageView 图像视图 | DraweeView | GenericDraweeView | SimpleDraweeView | |
AppCompatImageView | OverflowMenuButton | |||
AppCompatImageView | OverflowMenuButton | |||
ImageButton 图像按钮 | ZoomButton | |||
VisibilityAwareImageButton | FloatingActionButton | |||
AppCompatImageButton | ||||
ProgressBar 进度条 | ContentLoadingProgressBar | |||
AbsSeekBar | RatingBar | AppCompatRatingBar | ||
SeekBar | AppCompatSeekBar | |||
SurfaceView | GLSurfaceView | |||
VideoView 视频视图 | ||||
TextureView | ||||
Space | ||||
MediaRouteButton | ||||
KeyboardView | ||||
ViewStub | ||||
ViewStubCompat | ||||
AnalogClock | ||||
TabItem | ||||
ViewGroup | LinearLayoutCompat | ActionMenuView | ||
InnerLayout | ||||
ForegroundLinearLayout | NavigationMenuItemView | |||
SearchView | ||||
TabView | ||||
ActivityChooserView | ||||
CoordinatorLayout | ||||
LinearLayout 线性布局 | AppBarLayout | |||
ButtonBarLayout | ||||
ZoomControls | ||||
SearchView | MySearchView | |||
TableLayout 表格布局 | ||||
SLidingTabStrip | ||||
TabView | ||||
RadioGrop | ||||
FitWindowsLinearLayout | ||||
TextInputLayout | ||||
ActionMenuView | ||||
SnackbarLayout | ||||
TableRow | ||||
ListMenuItemView | ||||
TabWidget | ||||
NumberPicker | ||||
PagerTitleStrip | PagerTabStrip | |||
FramentBreadCrumbs | ||||
FrameLayout 帧布局 | CalendarView | |||
FitWindowsFrameLayout | ||||
CollapsingToolbarLayout | ||||
CollapsibleActionViewWrapper | ||||
MediaController | ||||
TabHost | FragmentTabHost | |||
GestureOverlayView | ||||
DataPicker | ||||
ScrimInsetsFrameLayout | NavigationView | |||
HorizontalScrollView | TabLayout | |||
ScrollingTabContainerView | ||||
ActionBarContainer | ||||
ScrollView | ||||
AppWidgetHostView | ||||
ViewAnimator 视图动画 | ViewSwitcher | TextSwitcher | ||
ImageSwitcher | ||||
ViewFlipper | ||||
TimePicker | ||||
NestedScrollView | ||||
ContentFrameLayout | ListMenuDecorView | |||
NoSaveStateFrameLayout | ||||
ConstraintLayout 约束布局 | WebView | |||
RelativeLayout 相对布局 | TwoLineListItem | |||
DialerFilter | ||||
SlidingDrawer | ||||
AdapterView | AdapterViewAnimator | StackView | ||
AdapterViewFlipper | ||||
AbsSpinner | Gallery | |||
Spinner | ||||
AbsListView | GridView 网格视图 | |||
ListView 列表视图 | ExpandedMenuView | |||
DropDownListView | ||||
ExpandableListView | ||||
AbsActionBarView | ActionBarContextView | |||
DrawerLayout | ||||
TvView | ||||
ActionBarOverlayLayout | ||||
SwipeRefreshLayout | ||||
SlidingPaneLayout | ||||
GridLayout |