当前位置: 首页 > news >正文

应用界面主题Theme使用方法

主题Theme就是用来设置界面UI风格,可以设置整个应用或者某个活动Activity的界面风格。在Android SDK中内置了下面的Theme,可以按标题栏Title Bar和状态栏Status Bar是否可见来分类:


[html] view plain copy print ?
  1. android:theme="@android:style/Theme.Dialog" 将一个Activity显示为能话框模式
  2. android:theme="@android:style/Theme.NoTitleBar" 不显示应用程序标题栏
  3. android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 不显示应用程序标题栏,并全屏
  4. android:theme="Theme.Light" 背景为白色
  5. android:theme="Theme.Light.NoTitleBar" 白色背景并无标题栏
  6. android:theme="Theme.Light.NoTitleBar.Fullscreen" 白色背景,无标题栏,全屏
  7. android:theme="Theme.Black" 背景黑色
  8. android:theme="Theme.Black.NoTitleBar" 黑色背景并无标题栏
  9. android:theme="Theme.Black.NoTitleBar.Fullscreen" 黑色背景,无标题栏,全屏
  10. android:theme="Theme.Wallpaper" 用系统桌面为应用程序背景
  11. android:theme="Theme.Wallpaper.NoTitleBar" 用系统桌面为应用程序背景,且无标题栏
  12. android:theme="Theme.Wallpaper.NoTitleBar.Fullscreen" 用系统桌面为应用程序背景,无标题栏,全屏
  13. android:theme="Translucent" 半透明
  14. android:theme="Theme.Translucent.NoTitleBar" 半透明、无标题栏
  15. android:theme="Theme.Translucent.NoTitleBar.Fullscreen" 半透明、无标题栏、全屏
  16. android:theme="Theme.Panel"
  17. android:theme="Theme.Light.Panel"
[html] view plain copy print ?
  1. android:theme="@android:style/Theme.Dialog"将一个Activity显示为能话框模式
  2. android:theme="@android:style/Theme.NoTitleBar"不显示应用程序标题栏
  3. android:theme="@android:style/Theme.NoTitleBar.Fullscreen"不显示应用程序标题栏,并全屏
  4. android:theme="Theme.Light"背景为白色
  5. android:theme="Theme.Light.NoTitleBar"白色背景并无标题栏
  6. android:theme="Theme.Light.NoTitleBar.Fullscreen"白色背景,无标题栏,全屏
  7. android:theme="Theme.Black"背景黑色
  8. android:theme="Theme.Black.NoTitleBar"黑色背景并无标题栏
  9. android:theme="Theme.Black.NoTitleBar.Fullscreen"黑色背景,无标题栏,全屏
  10. android:theme="Theme.Wallpaper"用系统桌面为应用程序背景
  11. android:theme="Theme.Wallpaper.NoTitleBar"用系统桌面为应用程序背景,且无标题栏
  12. android:theme="Theme.Wallpaper.NoTitleBar.Fullscreen"用系统桌面为应用程序背景,无标题栏,全屏
  13. android:theme="Translucent"半透明
  14. android:theme="Theme.Translucent.NoTitleBar"半透明、无标题栏
  15. android:theme="Theme.Translucent.NoTitleBar.Fullscreen"半透明、无标题栏、全屏
  16. android:theme="Theme.Panel"
  17. android:theme="Theme.Light.Panel"
•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="Translucent"  半透明
•android:theme="Theme.Translucent.NoTitleBar" 半透明、无标题栏
•android:theme="Theme.Translucent.NoTitleBar.Fullscreen" 半透明、无标题栏、全屏
•android:theme="Theme.Panel"
•android:theme="Theme.Light.Panel"




这些主题可以应用到整个应用Application范围或者某个活动Activity范围中。

应用Application范围
在AndroidManifest.xml中的application节点中设置theme属性,主题theme应用到整个应用程序中。
<application
Android:icon=”@drawable/icon”
Android:icon=”@string/app_name”
Android:icon=”@android:style/ Theme.Black.NoTitleBar”>

活动Activity范围
使用java代码或者在AndroidManifest.xml中对活动Activity的主题进行设置,主题仅应用到当前活动中。
在AndroidMainifest.xml设置方法:
<activity
android:name=“.About”
android:label=“@string/app_name”
android:theme=“@android:style/ Theme.Black.NoTitleBar” >

使用java代码进行设置,在当前活动Activity的onCreate中进行设置:
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setTheme(android.R.style.Theme_Translucent_NoTitleBar);
setContentView(R.layout.main);
}

文章来自: http://blog.csdn.net/kaiwii/article/details/7825517

主题Theme就是用来设置界面UI风格,可以设置整个应用或者某个活动Activity的界面风格。在Android SDK中内置了下面的Theme,可以按标题栏Title Bar和状态栏Status Bar是否可见来分类:


[html] view plain copy print ?
  1. android:theme="@android:style/Theme.Dialog" 将一个Activity显示为能话框模式
  2. android:theme="@android:style/Theme.NoTitleBar" 不显示应用程序标题栏
  3. android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 不显示应用程序标题栏,并全屏
  4. android:theme="Theme.Light" 背景为白色
  5. android:theme="Theme.Light.NoTitleBar" 白色背景并无标题栏
  6. android:theme="Theme.Light.NoTitleBar.Fullscreen" 白色背景,无标题栏,全屏
  7. android:theme="Theme.Black" 背景黑色
  8. android:theme="Theme.Black.NoTitleBar" 黑色背景并无标题栏
  9. android:theme="Theme.Black.NoTitleBar.Fullscreen" 黑色背景,无标题栏,全屏
  10. android:theme="Theme.Wallpaper" 用系统桌面为应用程序背景
  11. android:theme="Theme.Wallpaper.NoTitleBar" 用系统桌面为应用程序背景,且无标题栏
  12. android:theme="Theme.Wallpaper.NoTitleBar.Fullscreen" 用系统桌面为应用程序背景,无标题栏,全屏
  13. android:theme="Translucent" 半透明
  14. android:theme="Theme.Translucent.NoTitleBar" 半透明、无标题栏
  15. android:theme="Theme.Translucent.NoTitleBar.Fullscreen" 半透明、无标题栏、全屏
  16. android:theme="Theme.Panel"
  17. android:theme="Theme.Light.Panel"
[html] view plain copy print ?
  1. android:theme="@android:style/Theme.Dialog"将一个Activity显示为能话框模式
  2. android:theme="@android:style/Theme.NoTitleBar"不显示应用程序标题栏
  3. android:theme="@android:style/Theme.NoTitleBar.Fullscreen"不显示应用程序标题栏,并全屏
  4. android:theme="Theme.Light"背景为白色
  5. android:theme="Theme.Light.NoTitleBar"白色背景并无标题栏
  6. android:theme="Theme.Light.NoTitleBar.Fullscreen"白色背景,无标题栏,全屏
  7. android:theme="Theme.Black"背景黑色
  8. android:theme="Theme.Black.NoTitleBar"黑色背景并无标题栏
  9. android:theme="Theme.Black.NoTitleBar.Fullscreen"黑色背景,无标题栏,全屏
  10. android:theme="Theme.Wallpaper"用系统桌面为应用程序背景
  11. android:theme="Theme.Wallpaper.NoTitleBar"用系统桌面为应用程序背景,且无标题栏
  12. android:theme="Theme.Wallpaper.NoTitleBar.Fullscreen"用系统桌面为应用程序背景,无标题栏,全屏
  13. android:theme="Translucent"半透明
  14. android:theme="Theme.Translucent.NoTitleBar"半透明、无标题栏
  15. android:theme="Theme.Translucent.NoTitleBar.Fullscreen"半透明、无标题栏、全屏
  16. android:theme="Theme.Panel"
  17. android:theme="Theme.Light.Panel"
•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="Translucent"  半透明
•android:theme="Theme.Translucent.NoTitleBar" 半透明、无标题栏
•android:theme="Theme.Translucent.NoTitleBar.Fullscreen" 半透明、无标题栏、全屏
•android:theme="Theme.Panel"
•android:theme="Theme.Light.Panel"




这些主题可以应用到整个应用Application范围或者某个活动Activity范围中。

应用Application范围
在AndroidManifest.xml中的application节点中设置theme属性,主题theme应用到整个应用程序中。
<application
Android:icon=”@drawable/icon”
Android:icon=”@string/app_name”
Android:icon=”@android:style/ Theme.Black.NoTitleBar”>

活动Activity范围
使用java代码或者在AndroidManifest.xml中对活动Activity的主题进行设置,主题仅应用到当前活动中。
在AndroidMainifest.xml设置方法:
<activity
android:name=“.About”
android:label=“@string/app_name”
android:theme=“@android:style/ Theme.Black.NoTitleBar” >

使用java代码进行设置,在当前活动Activity的onCreate中进行设置:
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setTheme(android.R.style.Theme_Translucent_NoTitleBar);
setContentView(R.layout.main);
}

主题Theme就是用来设置界面UI风格,可以设置整个应用或者某个活动Activity的界面风格。在Android SDK中内置了下面的Theme,可以按标题栏Title Bar和状态栏Status Bar是否可见来分类:


[html] view plain copy print ?
  1. android:theme="@android:style/Theme.Dialog" 将一个Activity显示为能话框模式
  2. android:theme="@android:style/Theme.NoTitleBar" 不显示应用程序标题栏
  3. android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 不显示应用程序标题栏,并全屏
  4. android:theme="Theme.Light" 背景为白色
  5. android:theme="Theme.Light.NoTitleBar" 白色背景并无标题栏
  6. android:theme="Theme.Light.NoTitleBar.Fullscreen" 白色背景,无标题栏,全屏
  7. android:theme="Theme.Black" 背景黑色
  8. android:theme="Theme.Black.NoTitleBar" 黑色背景并无标题栏
  9. android:theme="Theme.Black.NoTitleBar.Fullscreen" 黑色背景,无标题栏,全屏
  10. android:theme="Theme.Wallpaper" 用系统桌面为应用程序背景
  11. android:theme="Theme.Wallpaper.NoTitleBar" 用系统桌面为应用程序背景,且无标题栏
  12. android:theme="Theme.Wallpaper.NoTitleBar.Fullscreen" 用系统桌面为应用程序背景,无标题栏,全屏
  13. android:theme="Translucent" 半透明
  14. android:theme="Theme.Translucent.NoTitleBar" 半透明、无标题栏
  15. android:theme="Theme.Translucent.NoTitleBar.Fullscreen" 半透明、无标题栏、全屏
  16. android:theme="Theme.Panel"
  17. android:theme="Theme.Light.Panel"
[html] view plain copy print ?
  1. android:theme="@android:style/Theme.Dialog"将一个Activity显示为能话框模式
  2. android:theme="@android:style/Theme.NoTitleBar"不显示应用程序标题栏
  3. android:theme="@android:style/Theme.NoTitleBar.Fullscreen"不显示应用程序标题栏,并全屏
  4. android:theme="Theme.Light"背景为白色
  5. android:theme="Theme.Light.NoTitleBar"白色背景并无标题栏
  6. android:theme="Theme.Light.NoTitleBar.Fullscreen"白色背景,无标题栏,全屏
  7. android:theme="Theme.Black"背景黑色
  8. android:theme="Theme.Black.NoTitleBar"黑色背景并无标题栏
  9. android:theme="Theme.Black.NoTitleBar.Fullscreen"黑色背景,无标题栏,全屏
  10. android:theme="Theme.Wallpaper"用系统桌面为应用程序背景
  11. android:theme="Theme.Wallpaper.NoTitleBar"用系统桌面为应用程序背景,且无标题栏
  12. android:theme="Theme.Wallpaper.NoTitleBar.Fullscreen"用系统桌面为应用程序背景,无标题栏,全屏
  13. android:theme="Translucent"半透明
  14. android:theme="Theme.Translucent.NoTitleBar"半透明、无标题栏
  15. android:theme="Theme.Translucent.NoTitleBar.Fullscreen"半透明、无标题栏、全屏
  16. android:theme="Theme.Panel"
  17. android:theme="Theme.Light.Panel"
•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="Translucent"  半透明
•android:theme="Theme.Translucent.NoTitleBar" 半透明、无标题栏
•android:theme="Theme.Translucent.NoTitleBar.Fullscreen" 半透明、无标题栏、全屏
•android:theme="Theme.Panel"
•android:theme="Theme.Light.Panel"




这些主题可以应用到整个应用Application范围或者某个活动Activity范围中。

应用Application范围
在AndroidManifest.xml中的application节点中设置theme属性,主题theme应用到整个应用程序中。
<application
Android:icon=”@drawable/icon”
Android:icon=”@string/app_name”
Android:icon=”@android:style/ Theme.Black.NoTitleBar”>

活动Activity范围
使用java代码或者在AndroidManifest.xml中对活动Activity的主题进行设置,主题仅应用到当前活动中。
在AndroidMainifest.xml设置方法:
<activity
android:name=“.About”
android:label=“@string/app_name”
android:theme=“@android:style/ Theme.Black.NoTitleBar” >

使用java代码进行设置,在当前活动Activity的onCreate中进行设置:
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setTheme(android.R.style.Theme_Translucent_NoTitleBar);
setContentView(R.layout.main);
}

相关文章:

  • 参数声明中的静态数组索引:一个不错且鲜为人知的C语言特性
  • 远程服务化的思路整理
  • Android游戏框架AndEngine使用入门
  • 好的程序员应该第一时间去Google
  • 短信技术的几个基本概念
  • log4j:WARN No appenders could be found for logger
  • gbs使用手册之配置文件
  • gbs使用手册之gbs build
  • gbs使用手册之gbs chroot
  • 如何用doxygen生成文档
  • FreeMarker教程
  • Timer、TimerTask实现定时业务处理
  • windows宿主机与linux目标机联网通信
  • 腾讯面试题(持续更新ing)
  • 几种排序算法与运用实例
  • 【vuex入门系列02】mutation接收单个参数和多个参数
  • axios请求、和返回数据拦截,统一请求报错提示_012
  • Druid 在有赞的实践
  • leetcode-27. Remove Element
  • Linux gpio口使用方法
  • Python学习之路16-使用API
  • Spring Cloud Feign的两种使用姿势
  • 大数据与云计算学习:数据分析(二)
  • 缓存与缓冲
  • 老板让我十分钟上手nx-admin
  • 嵌入式文件系统
  • 想写好前端,先练好内功
  • 译有关态射的一切
  • HanLP分词命名实体提取详解
  • (04)odoo视图操作
  • (AngularJS)Angular 控制器之间通信初探
  • (Matalb回归预测)PSO-BP粒子群算法优化BP神经网络的多维回归预测
  • (NO.00004)iOS实现打砖块游戏(九):游戏中小球与反弹棒的碰撞
  • (TOJ2804)Even? Odd?
  • (附源码)计算机毕业设计SSM智能化管理的仓库管理
  • (亲测)设​置​m​y​e​c​l​i​p​s​e​打​开​默​认​工​作​空​间...
  • (太强大了) - Linux 性能监控、测试、优化工具
  • (一)C语言之入门:使用Visual Studio Community 2022运行hello world
  • (转)ABI是什么
  • (转)chrome浏览器收藏夹(书签)的导出与导入
  • *p++,*(p++),*++p,(*p)++区别?
  • .gitattributes 文件
  • .Net 垃圾回收机制原理(二)
  • .NET 中使用 Mutex 进行跨越进程边界的同步
  • .net之微信企业号开发(一) 所使用的环境与工具以及准备工作
  • @JSONField或@JsonProperty注解使用
  • @kafkalistener消费不到消息_消息队列对战之RabbitMq 大战 kafka
  • @value 静态变量_Python彻底搞懂:变量、对象、赋值、引用、拷贝
  • @基于大模型的旅游路线推荐方案
  • @我的前任是个极品 微博分析
  • [ C++ ] STL---仿函数与priority_queue
  • []常用AT命令解释()
  • [ACM] hdu 1201 18岁生日
  • [BUG] Authentication Error
  • [C++]Leetcode17电话号码的字母组合