Android布局详解
Android 提供了多种布局,如下
- LinearLayout
- RelativeLayout
- FrameLayout
- TableLayout
- AbsoluteLayout
- GridLayout
- ConstraintLayout 重要
- MotionLayout
- CoordinatorLayout 重要
这些布局均继承 ViewGroup,而 ViewGroup 继承自 View,如下图
graph TD;
View-->ViewGroup;
ViewGroup-->LinearLayout;
ViewGroup-->RelativeLayout;
ViewGroup-->FrameLayout;
ViewGroup-->AbsoluteLayout;
ViewGroup-->GridLayout;
ViewGroup-->ConstraintLayout;
ConstraintLayout-->MotionLayout;
LinearLayout-->TableLayout;
ViewGroup-->CoordinatorLayout;
stateDiagram-v2
state Activity {
state Window{
state DecorView{
[*] --> NumLockOff3
}
}
}
# View
# ViewGroup
# LinearLayout
# RelativeLayout
# FrameLayout
# TableLayout
# AbsoluteLayout
# GridLayout
# ConstraintLayout 重要
# CoordinatorLayout 重要
# MotionLayout
编辑此页 (opens new window)
上次更新: 2022-04-27, 19:56:11