Android中的主题

来源:互联网 发布:asp无组件上传源码 编辑:程序博客网 时间:2024/06/09 16:08

1、Android Theme

  • Hoho Theme
    在4.0之前Android可以说是没有设计可言的,在4.0之后推出了Android Design,从此Androd在设计上有了很大的改善,而在程序实现上相应的就是Holo风格,所以你看到有类似 Theme.Holo.Light、 Theme.Holo.Light.DarkActionBar 就死4.0的风格,但是为了让4.0之前的版本也能有这种风格怎么办呢?这个适合就不得不应用v7包,所以对应的就有 Teme.AppCompat.Light、Theme.AppCompat.Light.DarkActionBar,如果你的程序最新支持的版本是API14(即Android 4.0),那么可以不用考虑v7的兼容;

  • Material Design Theme
    Android 在5.0版本推出了Material Design的概念,这是Android设计上又一大突破。对应程序实现上就有Theme.Material.Light、Theme.Material.light.DarkActionBar等,但是这种风格只能应用在5.0版本的手机,如果在5.0之前应用Material Design改怎么办呢?同样的引用appcompat-v7包,这个时候的Theme.AppCompat.Light、Theme.AppCompat.Light.DarkActionBar就是相对应兼容的Material Design的Them;

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=”Theme.Translucent : 透明背景
android:theme=”Theme.Translucent.NoTitleBar” : 透明背景并无标题
android:theme=”Theme.Translucent.NoTitleBar.Fullscreen” : 透明背景并无标题,全屏
android:theme=”Theme.Panel “: 面板风格显示
android:theme=”Theme.Light.Panel” : 平板风格显示

0 0