Android:Style和Theme
来源:互联网 发布:verilog数据选择器 编辑:程序博客网 时间:2024/05/29 17:58
欢迎大家访问我的博客http://blog.csdn.net/mikejaps,专注于android ios app 开发
Style是针对窗体元素级别的,改变指定控件或者Layout的样式
Theme是针对窗体级别的,改变窗体样式;
style演示
定义一个styles,在res/values/目录下建立styles.xml:
<style name="mystyle" parent="AppBaseTheme"> <item name="android:textSize">18sp</item> <item name="android:textColor">#ff0000</item> </style>
<item name="属性">属性值</item>
1、在布局文件中引用style
<TextView style="@style/mystyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/hello_world" />
2、在程序中设置style
text.setTextAppearance(this, R.style.mystyle);
Theme演示
1、在manifest当中设置主题
theme的style可以定义在styles.xml中,也可以单独定义在自己新建的themes.xml:
<?xml version="1.0" encoding="utf-8"?><resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="myTheme" parent="AppBaseTheme"> <item name="android:windowNoTitle">true</item> <item name="android:windowFullscreen">?android:windowNoTitle</item> </style></resources>
如果整个工程用一个主题就在application 标签中定义
android:theme="@style/myTheme"
其他属性:可以在sdk查看:..\sdk\platforms\android-7\data\res\values\themes.xml
android:windowBackground 窗口背景
android:windowIsFloating 是否悬浮
android:windowIsTranslucent
android:windowContentOverlay
android:windowAnimationStyle
android:backgroundDimEnabled
0 0
- Android:Theme 和 style
- android style和theme
- Android:Style和Theme
- Android Style和Theme
- android:style和theme
- android笔记 style和theme
- android之theme和style
- Android中的style和theme
- Android的Style和Theme
- Android中的style和theme
- Android中的Theme和Style
- android定义theme和style
- Android 中的Theme和Style
- android使用theme和style
- android 中style和Theme
- Android中的style和theme
- Android开发Theme和Style
- android -详谈Style和Theme
- dos命令编译,运行java源代码文件
- Algorithms—234.Palindrome Linked List
- 算法小结
- 欢迎使用CSDN-markdown编辑器
- 开始学习java,整理博客
- Android:Style和Theme
- ELK学习4_Elasticsearch+Logstash+Kibana安装_简易版
- Spark 调优 (英文原文:Tuning Spark)
- dev GridView 自定义显示文本 CustomColumnDisplayText
- centos nodejs安装
- Smarty的配置
- Leetcode (4) Median of Two Sorted Arrays 解题报告
- 程序添加JComboBox的item也能触发itemStateChanged事件吗
- iOS开发必备--环境变量配置(Debug & Release)