1. 程式人生 > >Android中RelativeLayout各個屬性和自帶樣式 theme

Android中RelativeLayout各個屬性和自帶樣式 theme

Android中RelativeLayout各個屬性

android:layout_above="@id/xxx"  --將控制元件置於給定ID控制元件之上
android:layout_below="@id/xxx"  --將控制元件置於給定ID控制元件之下

android:layout_toLeftOf="@id/xxx"  --將控制元件的右邊緣和給定ID控制元件的左邊緣對齊
android:layout_toRightOf="@id/xxx"  --將控制元件的左邊緣和給定ID控制元件的右邊緣對齊

android:layout_alignLeft="@id/xxx"  --將控制元件的左邊緣和給定ID控制元件的左邊緣對齊
android:layout_alignTop="@id/xxx"  --將控制元件的上邊緣和給定ID控制元件的上邊緣對齊
android:layout_alignRight="@id/xxx"  --將控制元件的右邊緣和給定ID控制元件的右邊緣對齊
android:layout_alignBottom="@id/xxx"  --將控制元件的底邊緣和給定ID控制元件的底邊緣對齊
android:layout_alignParentLeft="true"  --將控制元件的左邊緣和父控制元件的左邊緣對齊
android:layout_alignParentTop="true"  --將控制元件的上邊緣和父控制元件的上邊緣對齊
android:layout_alignParentRight="true"  --將控制元件的右邊緣和父控制元件的右邊緣對齊
android:layout_alignParentBottom="true" --將控制元件的底邊緣和父控制元件的底邊緣對齊
android:layout_centerInParent="true"  --將控制元件置於父控制元件的中心位置
android:layout_centerHorizontal="true"  --將控制元件置於水平方向的中心位置
android:layout_centerVertical="true"  --將控制元件置於垂直方向的中心位置


android自帶樣式 theme


android:theme="@android:style/Theme.Dialog" 將一個Activity顯示為能話框模式 
android:theme="@android:style/Theme.NoTitleBar" 不顯示應用程式標題欄 
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 不顯示應用程式標題欄,並全屏 
android:theme="Theme.Light" 背景為白色 
android:theme="Theme.Light.NoTitleBar" 白色背景並無標題欄 


android:theme="Theme.Light.NoTitleBar.Fullscreen" 白色背景,無標題欄,全屏 
android:theme="Theme.Black" 背景黑色 
android:theme="Theme.Black.NoTitleBar" 黑色背景並無標題欄 
android:theme="Theme.Black.NoTitleBar.Fullscreen" 黑色背景,無標題欄,全屏 
android:theme="Theme.Wallpaper" 用系統桌面為應用程式背景 
android:theme="Theme.Wallpaper.NoTitleBar" 用系統桌面為應用程式背景,且無標題欄 

android:theme="Theme.Wallpaper.NoTitleBar.Fullscreen" 用系統桌面為應用程式背景,無標題欄,全屏 
android:theme="Translucent"  透明背景
android:theme="Theme.Translucent.NoTitleBar"  透明背景並無標題
android:theme="Theme.Translucent.NoTitleBar.Fullscreen"  透明背景並無標題,全屏
android:theme="Theme.Panel"   面板風格顯示
android:theme="Theme.Light.Panel" 平板風格顯示