android:layout_width:寬度
android:layout_height:高度
android:layout_weight:比例?
wrap_content:控件內(nèi)部有多大铜靶,寬高就有多大(自適應(yīng))
match_parent:占滿整個(gè)父控件
android:background:背景填充噪服,顏色 圖片
android:visibility:用來顯示/隱藏控件
visible:可見 gone/invisible 不可見
gone:真實(shí)不可見矾削,也不占據(jù)位置 invisible:不可見拦惋,但是占據(jù)位置
android:layout_margin:外邊距
android:padding:內(nèi)邊距
如果讓一個(gè)View直接添加子控件,是不允許的,此時(shí)應(yīng)該直接使用ViewGroup控件
ViewGroup :
????????????-LinearLayout? ? ? 線性布局
????????????-RelativeLayout? ? 相對布局
????????????-AbsoluteLayout? ? 據(jù)對布局
????????????-FrameLayout? ? ? ? 幀布局
????????????-TableLayout? ? ? ? 表格布局
針對父控件布局 :
????????????-android:layout_centerHorizontal? ? ? ???? 橫向居中
????????????-android:layout_centerVertical? ? ? ? ? ? ? ? 縱向居中
????????????-android:layout_centerInParent? ? ? ? ? ? ? 橫向縱向居中
????????????-android:layout_alignParentBottom? ? ? ? 和父控件底部對齊
????????????-android:layout_alignParentTop? ? ? ? ? ? ? 和父控件頂部對齊
????????????-android:layout_alignParentLeft? ? ? ? ? ? ? 和父控件最左邊對齊
????????????-android:layout_alignParentRight? ? ? ? ? ? 和父控件最右邊對齊
針對兄弟控件布局 :
????????????-android:layout_above? ? ? ? ? ? ? ? ????? 在兄弟控件的上面
????????????-android:layout_below? ? ? ? ? ? ? ? ????? 在兄弟控件的下面
????????????-android:layout_toLeftOf? ? ? ? ? ? ????? 在兄弟控件的左邊
????????????-android:layout_toRightOf? ? ? ? ? ? ? ? 在兄弟控件的右邊
????????????-android:layout_alignTop? ? ? ? ? ? ????? 和兄弟控件頂部對齊
????????????-android:layout_alignBottom? ? ? ? ? ? 和兄弟控件底部對齊
????????????-android:layout_alignLeft? ? ? ? ? ????? ? 和兄弟控件最左邊對齊
????????????-android:layout_alignRight? ? ? ? ? ????? 和兄弟控件最右邊對齊