Android系統自帶樣式(android:theme)

Android系統自帶樣式(android:theme)

 

 

Theme.Dialog : (圖1)Activity顯示爲對話框模式

Theme.NoTitleBar : (圖2)不顯示應用程序標題欄

Theme.NoTitleBar.Fullscreen : (圖3)不顯示應用程序標題欄,並全屏

Theme.Light : (圖4)背景爲白色

Theme.Light.NoTitleBar : (圖5)白色背景並無標題欄

Theme.Light.NoTitleBar.Fullscreen : (圖6)白色背景,無標題欄,全屏

Theme.Black : (圖7)背景黑色

Theme.Black.NoTitleBar : (圖8)黑色背景並無標題欄

Theme.Black.NoTitleBar.Fullscreen : (圖9)黑色背景,無標題欄,全屏

Theme.Wallpaper : (圖10)用系統桌面爲應用程序背景

Theme.Wallpaper.NoTitleBar : (圖11) 用系統桌面爲應用程序背景,且無標題欄

Theme.Wallpaper.NoTitleBar.Fullscreen : (圖12)用系統桌面爲應用程序背景,無標題欄,全屏

Theme.Translucent : (圖13)透明背景

Theme.Translucent.NoTitleBar : (圖14)透明背景並無標題

Theme.Translucent.NoTitleBar.Fullscreen : (圖15)透明背景並無標題,全屏

Theme.Panel : (圖16)面板風格顯示

Theme.Light.Panel : (圖17)平板風格顯示

樣式對應效果圖

 



 圖1(Theme.Dialog)

 



 圖2(Theme.NoTitleBar)

 



 圖3(Theme.NoTitleBar.Fullscreen)


 圖4(Theme.Light)

 


 圖5(Theme.Light.NoTitleBar)


 圖6(Theme.Light.NoTitleBar.Fullscreen)

 



 圖7(Theme.Black)

 



 圖8(Theme.Black.NoTitleBar)

 



 圖9(Theme.Black.NoTitleBar.Fullscreen)

 



 圖10(Theme.Wallpaper)

 



 圖11(Theme.Wallpaper.NoTitleBar)

 



 圖12(Theme.Wallpaper.NoTitleBar.Fullscreen)

 




  圖13(Theme.Translucent)

頁面元素:1個按鈕

 




  圖14(Theme.Translucent.NoTitleBar)

頁面元素:1個按鈕

 



 

 圖15(Theme.Translucent.NoTitleBar.Fullscreen)

頁面元素:1個按鈕

顯示按鈕顯示在最上面,因爲是透明的,所以被外面的狀態欄擋住了上半部分

 



 圖16(Theme.Panel)

頁面元素:1個按鈕

 



 圖17(Theme.Light.Panel)

頁面元素:1個按鈕

 

Android系統自帶樣式使用方法:

 將樣式代碼放置在應用的AndroidManifest.xml即可。

 注意格式:android:theme="@android:style/這裏寫樣式代碼 "

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.zhouzijing.android"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="8" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".demo2"
        		  android:theme="@android:style/Theme.Dialog"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>
</manifest>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章