今天對api中style下的theme整個摸了一遍。
我將api中theme分為兩種類型來實驗;一種是api Level為11的,一種是11以下的。level為11的用的是3.0的模擬器,11以下用的是N1,2.3.3的系統。
這里我是統一將theme寫在AndroidManifest.xml中定義,如下圖:
先總結level為11以下的theme:
1、Theme:
它的意思為默認狀態,即如果theme這里不填任何屬性的時候,默認為Theme。
api原文為:
The default system theme. This is the theme used for activities that have not explicitly set their own theme.
You can count on this being a dark background with light text on top, but should try to make no other assumptions about its appearance. In particular, the text inside of widgets using this theme may be completely different, with the widget container being a light color and the text on top of it a dark color.
效果圖如下:
1.1 、 Theme_NoDisplay
它的意思為任何都不顯示。比較適用于只是運行了activity,但未顯示任何東西。
api原文如下:
Default theme for activities that don’t actually display a UI; that is, they finish themselves before being resumed.
效果圖如下:
1.2、Theme_NoTitleBar
意思為:背景主題的沒有標題欄的樣式,默認如果沒有設置的話,顯示黑背景
api原文:
Variant of the default (dark) theme with no title bar
效果圖如下:
1.3、Theme_NoTitleBar_Fullscreen
意思為:背景主題的沒有標題欄且全屏的樣式,默認為黑背景
api原文:
Variant of the default (dark) theme that has no title bar and fills the entire screen
效果圖如下:
2、Theme_Black:
它的意思為默認狀態下黑背景。
api原文如下:
Special variation on the default theme that ensures the background is completely black. This is useful for things like image viewers and media players. If you want the normal (dark background) theme do
not
use this, use
Theme
.
效果圖如下:
2.1、Theme_Black_NoTitleBar:
意思為:黑背景主題的沒有標題欄的樣式
api原文:
Variant of the black theme with no title bar
效果圖如下:
2.2、Theme_Black_NoTitleBar_Fullscreen
意思為:黑背景主題的沒有標題欄且全屏的樣式
api原文:
Variant of the black theme that has no title bar and fills the entire screen
效果圖如下:
3、Theme_Light
意思為:默認狀態下亮背景,與上述黑背景Theme_Black相反。
api原文:
Theme for a light background with dark text on top. Set your activity to this theme if you would like such an appearance. As with the default theme, you should try to assume little more than that the background will be a light color.
效果圖如下:
3.1、Theme_Light_NoTitleBar
意思為:亮背景主題的沒有標題欄的樣式,與Theme_Black_NoTitleBar相反
api原文:
Variant of the light theme with no title bar
效果圖如下:
3.2、Theme_Light_NoTitleBar_Fullscreen
意思為:亮背景主題的沒有標題欄且全屏顯示的樣式,與Theme_Black_NoTitleBa_Fullscreenr相反
api原文:
Variant of the light theme that has no title bar and fills the entire screen
效果圖如下:
4、Theme_Dialog
意思為:對話框樣式 將整個activity變成對話框樣式出現。
api原文:
Default theme for dialog windows and activities, which is used by the
Dialog
class. This changes the window to be floating (not fill the entire screen), and puts a frame around its contents. You can set this theme on an activity if you would like to make an activity that looks like a Dialog.
效果圖如下:這里需要自定義大小,否則顯示不全。
5、Theme_InputMethod
6、 Theme_Panel
意思為:刪除掉所有多余的窗口裝飾,在一個空的矩形框中填充內容,作用范圍相當于把dialog中的所有元素全部去掉,只是一個空的矩形框,且此為默認的樣式。
api原文:
Default dark theme for panel windows. This removes all extraneous window decorations, so you basically have an empty rectangle in which to place your content. It makes the window floating, with a transparent background, and turns off dimming behind the window.
效果圖如下:這里需要自定義大小,否則顯示不全。
6.1、 Theme_Light_Panel
意思為:刪除掉所有多余的窗口裝飾,在一個空的矩形框中填充內容,作用范圍相當于把dialog中的所有元素全部去掉,只是一個空的矩形框,且默認是light的樣式。
api原文:
Default light theme for panel windows. This removes all extraneous window decorations, so you basically have an empty rectangle in which to place your content. It makes the window floating, with a transparent background, and turns off dimming behind the window.
效果圖如下:這里需要自定義大小,否則顯示不全。
7、
Theme_Wallpaper
意思為:使用墻紙做主題,默認狀態。
api原文:
Default theme for windows that want to have the user’s selected wallpaper appear behind them.
效果圖如下:
7.1、Theme_WallpaperSettings
意思為:使用墻紙做主題,默認是使用將上一個界面調暗之后作為主題,(這里我很疑惑為什么是上一個界面變暗而不是墻紙主題變暗呢?)
api原文:
Theme for a wallpaper’s setting activity that is designed to be on top of a dark background.
效果圖如下:
7.2、Theme_Light_WallpaperSettings
意思為:使用墻紙做主題,默認Light狀態。
api原文:
Theme for a wallpaper’s setting activity that is designed to be on top of a light background.
效果圖如下:
7.3、Theme_Wallpaper_NoTitleBar
意思為:使用墻紙做主題,且沒有標題欄
api原文:
Variant of the translucent theme with no title bar
效果圖如下:
7.4、Theme_Wallpaper_NoTitleBar_Fullscreen
意思為:使用墻紙做主題,且沒有標題欄,且全屏顯示
api原文:
Variant of the translucent theme that has no title bar and fills the entire screen
效果圖如下:
8、Theme_Translucent
意思為:半透明狀態下的背景,將運行此activity之前的屏幕作為半透明狀態作為此activity運行時的樣式。
api原文:
Default theme for translucent activities, that is windows that allow you to see through them to the windows behind. This sets up the translucent flag and appropriate animations for your windows.
效果圖如下:
8.1、Theme_Translucent_NoTitleBar
意思為:半透明狀態下沒有標題欄的背景,將運行此activity之前的屏幕作為半透明狀態作為此activity運行時的樣式。
api原文:
Variant of the translucent theme with no title bar
效果圖如下:
8.2、Theme_Translucent_NoTitleBar_Fullscreen
意思為:半透明狀態下沒有標題欄且全屏的背景,將運行此activity之前的屏幕作為半透明狀態作為此activity運行時的樣式。
api原文:
Variant of the translucent theme that has no title bar and fills the entire screen
效果圖如下:
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
