android的布局-----FrameLayout(幀布局),幀布局framelayout
(-)幀布局簡介
幀版面配置容器為每個加入的其中的組件建立一個空白的地區稱為一幀每個子組件佔據一幀,這些幀都會根據gravity的屬性執行自動對齊
(二)屬性
foreground:這是幀布局的前景映像
foregroundGravity:定義繪製前景圖片的gravity屬性
(三)使用
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <FrameLayoutandroid:layout_width="match_parent" android:layout_height="wrap_content" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:width="300dp" android:height="300dp" android:background="#f00"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:width="200dp" android:height="200dp" android:background="#0f0"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:width="100dp" android:height="100dp" android:background="#00f"/> </FrameLayout></LinearLayout>