`
zhouxiaoli521
  • 浏览: 554270 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

android Theme使用总结

阅读更多

今天对api中style下的theme整个摸了一遍。

我将api中theme分为两种类型来实验;一种是api Level为11的,一种是11以下的。level为11的用的是3.0的模拟器,11以下用的是N1,2.3.3的系统。

这里我是统一将theme写在AndroidManifest.xml中定义,如下图:

image

 

先总结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.

效果图如下:

Theme 

1.1Theme_NoDisplay

它的意思为任何都不显示。比较适用于只是运行了activity,但未显示任何东西。

api原文如下:

Default theme for activities that don’t actually display a UI; that is, they finish themselves before being resumed.

 

效果图如下:

Theme_NoDisplay

1.2、Theme_NoTitleBar

意思为:背景主题的没有标题栏的样式,默认如果没有设置的话,显示黑背景

api原文:

Variant of the default (dark) theme with no title bar

效果图如下:

Theme_NoTitleBar

1.3、Theme_NoTitleBar_Fullscreen

意思为:背景主题的没有标题栏且全屏的样式,默认为黑背景

api原文:

Variant of the default (dark) theme that has no title bar and fills the entire screen

效果图如下:

Theme_NoTitleBar_Fullscreen

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.

效果图如下:

Theme_Black 

2.1、Theme_Black_NoTitleBar:

意思为:黑背景主题的没有标题栏的样式

api原文:

Variant of the black theme with no title bar

效果图如下:

Theme_Black_NoTitleBar

2.2、Theme_Black_NoTitleBar_Fullscreen

意思为:黑背景主题的没有标题栏且全屏的样式

api原文:

Variant of the black theme that has no title bar and fills the entire screen

效果图如下:

Theme_Black_NoTitleBar_Fullscreen

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.

效果图如下:

Theme_Light

3.1、Theme_Light_NoTitleBar

意思为:亮背景主题的没有标题栏的样式,与Theme_Black_NoTitleBar相反

api原文:

Variant of the light theme with no title bar

效果图如下:

Theme_Light_NoTitleBar

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

效果图如下:

Theme_Light_NoTitleBar_Fullscreen 

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.

效果图如下:这里需要自定义大小,否则显示不全。

Theme_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.

效果图如下:这里需要自定义大小,否则显示不全。

Theme_Panel

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.

效果图如下:这里需要自定义大小,否则显示不全。

 

Theme_Light_Panel 

7、

Theme_Wallpaper

意思为:使用墙纸做主题,默认状态。

api原文:

Default theme for windows that want to have the user’s selected wallpaper appear behind them.

效果图如下:

Theme_Wallpaper

7.1、Theme_WallpaperSettings

意思为:使用墙纸做主题,默认是使用将上一个界面调暗之后作为主题,(这里我很疑惑为什么是上一个界面变暗而不是墙纸主题变暗呢?)

api原文:

Theme for a wallpaper’s setting activity that is designed to be on top of a dark background.

效果图如下:

Theme_WallpaperSettings

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.

效果图如下:

Theme_Light_WallpaperSettings

7.3、Theme_Wallpaper_NoTitleBar

意思为:使用墙纸做主题,且没有标题栏

api原文:

Variant of the translucent theme with no title bar

效果图如下:

Theme_Wallpaper_NoTitleBar

7.4、Theme_Wallpaper_NoTitleBar_Fullscreen

意思为:使用墙纸做主题,且没有标题栏,且全屏显示

api原文:

Variant of the translucent theme that has no title bar and fills the entire screen

效果图如下:

Theme_Wallpaper_NoTitleBar_Fullscreen

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.

效果图如下:

Theme_Translucent

8.1、Theme_Translucent_NoTitleBar

意思为:半透明状态下没有标题栏的背景,将运行此activity之前的屏幕作为半透明状态作为此activity运行时的样式。

api原文:

Variant of the translucent theme with no title bar

效果图如下:

Theme_Translucent_NoTitleBar

8.2、Theme_Translucent_NoTitleBar_Fullscreen

意思为:半透明状态下没有标题栏且全屏的背景,将运行此activity之前的屏幕作为半透明状态作为此activity运行时的样式。

api原文:

Variant of the translucent theme that has no title bar and fills the entire screen

效果图如下:

Theme_Translucent_NoTitleBar_Fullscreen

 

以上是我对Level 11以下的theme的总结,后续我会对level 11的theme做总结。

 

http://henzil.easymorse.com/?p=364

分享到:
评论

相关推荐

    android_UI进阶之style和theme的使用

    android_UI进阶之style和theme的总结,供学习交流,谢谢~

    Android中Theme主题和Style样式使用介绍总结

    一,Theme主题 1.1,Theme主题作用范围 Theme主要是针对应用级别的或者说窗体级别,可以设置应用主题(应用换肤效果)或者Activity的主题;主题是不能应用在某一...Android系统提供的主题在:..\platforms\android-29\

    《Android应用开发》个人总结报告.doc

    《Android应用开发》个人总结报告 刚开始接触Android感觉到它很有意思,在界面开发上和web也可以形成了相通的架构 ,更加方便,视觉上也是非常的酷,在前期我通过的大量的Android SDK开发范例大全中的例子以及...

    总结一下Android中主题.zip_android

    总结一下Android中主题(Theme)的正确玩法

    Android移动开发实验6.doc

    <com.google.android.material.appbar.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay"> <androidx.appcompat.widget....

    Android ActionBarActivity设置全屏无标题实现方法总结

    Android ActionBarActivity设置全屏无标题实现方法总结 前言: 新建的Activity继承自ActionBarActivity,设置全屏无标题本来很简单的事,但是没想到app竟然无缘无故的挂,要么就是白屏一片,要么就是黑屏。坑了我一...

    Android 开发隐藏标题栏的方法总结

    android 开发隐藏标题栏的方法总结 1. 推荐!(因为现在工程都默认的为AppTheme) 在value/styles.xml里面添加自定义属性 <resources xmlns:android=http://schemas.android.com/apk/res/android> <!-- ...

    Android ActionBarActivity设置全屏无标题的方法总结

    Android ActionBarActivity设置全屏无标题的方法总结 新建的Activity继承自ActionBarActivity,设置全屏无标题本来很简单的事,但是没想到app竟然无缘无故的挂,要么就是白屏一片,要么就是黑屏。坑了我一个多小时!...

    Android4.2中全屏或者取消标题栏的方法总结

    先介绍去掉标题栏的方法: 第一种:也一般入门的时候经常使用的一种方法 requestWindowFeature(Window.FEATURE_NO_TITLE);...android:theme=”@android:style/Theme.NoTitleBar”>可以看出,这样写的话,整个

    Android 换肤技术资料整理

    而对于第二种,则相对复杂一些,由于作为一种线上服务,可能上架新皮肤,且那么多皮肤包放在apk里面实在太占体积了,所以皮肤资源会在选择后再进行下载,也就不能直接使用android的那套theme。 技术方案 内部资源...

    Android 状态栏的设置适配问题详解

    Android 状态栏的设置适配问题详解 最近看了很多关于状态栏的问题的处理,总结出处理状态栏分两个方向1>5.0一下2>5.0以上的手机状态栏的设置,,,,,,,,这里说的都是自定义的toolbar,我这里已经把titlebar给隐藏掉了 (1...

    Android实用的代码片段 常用代码总结

    1:查看是否有存储卡插入 代码如下: String status=Environment.getExternalStorageState(); if(status.equals(Enviroment.MEDIA_MOUNTED)) {  说明有SD卡插入 ...使用Activity.findViewById来取得

Global site tag (gtag.js) - Google Analytics