Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> Android開發實例 >> android Theme使用總結

android Theme使用總結

編輯:Android開發實例

今天對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.1Theme_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 效果圖如下:

 

 

以上是我對Level 11以下的theme的總結,後續我會對level 11的theme做總結。

  1. 上一頁:
  2. 下一頁:
熱門文章
閱讀排行版
Copyright © Android教程網 All Rights Reserved