Android 系统自带 Theme(主题)

 系统为我们提供了丰富的系统自带的Theme,当然,你也可以自定义Theme,前提是该Theme必须继承与某个已经存在地Theme,否则编译器会提示错误的。

1、 应用Theme属性两种方式

      ①、在AndroidManifest.xml文件中在<application/>或者<activity />节点设置android:theme属性.

      ②、直接在代码中调用方法setTheme()设置该Activity的主题,必须得在第一次调用setContentView()前设置。

 

常用的系统定义的Theme如下:

 

默认:

Theme

 

(1):android:theme="@android:style/Theme.Dialog" 将一个Activity显示为能话框模式 

Theme_Dialog


(2):android:theme="@android:style/Theme.NoTitleBar" 不显示应用程序标题栏 

Theme_NoTitleBar


(3):android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 不显示应用程序标题栏,并全屏 

Theme_NoTitleBar_Fullscreen


(4):android:theme="Theme.Light" 背景为白色 

Theme_Light


(5):android:theme="Theme.Light.NoTitleBar" 白色背景并无标题栏 

Theme_Light_NoTitleBar


(6):android:theme="Theme.Light.NoTitleBar.Fullscreen" 白色背景,无标题栏,全屏 

Theme_Light_NoTitleBar_Fullscreen


(7):android:theme="Theme.Black" 背景黑色 

Theme_Black


(8):android:theme="Theme.Black.NoTitleBar" 黑色背景并无标题栏 

Theme_Black_NoTitleBar


(9):android:theme="Theme.Black.NoTitleBar.Fullscreen" 黑色背景,无标题栏,全屏 

Theme_Black_NoTitleBar_Fullscreen

 


(10):android:theme="Theme.Wallpaper" 用系统桌面为应用程序背景

Theme_Wallpaper

 

 
(11):android:theme="Theme.Wallpaper.NoTitleBar" 用系统桌面为应用程序背景,且无标题栏 

Theme_Wallpaper_NoTitleBar

 


(12):android:theme="Theme.Wallpaper.NoTitleBar.Fullscreen" 用系统桌面为应用程序背景,无标题栏,全屏 

Theme_Wallpaper_NoTitleBar_Fullscreen


(13):android:theme="Translucent"  透明背景

Theme_Translucent


(14):android:theme="Theme.Translucent.NoTitleBar"  透明背景并无标题

Theme_Translucent_NoTitleBar


(15):android:theme="Theme.Translucent.NoTitleBar.Fullscreen"  透明背景并无标题,全屏

Theme_Translucent_NoTitleBar_Fullscreen

 


(16):android:theme="Theme.Panel"   面板风格显示

Theme_Panel


(17):android:theme="Theme.Light.Panel" 平板风格显示

Theme_Light_Panel

 

参考地址:

http://blog.csdn.net/xiaodongvtion/article/details/7873001

http://blog.chinaunix.net/uid-24448954-id-2846673.html

posted @ 2014-12-01 15:48  仰望 星空  阅读(1201)  评论(0)    收藏  举报