简单说类似与自定义控件,只不过自定义控件针对的是view 而样式与主题针对的是属性、元素

在TexvView中引入样式

layout.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" > <TextView
style="@style/text_content_style"
android:text="haha" /> <TextView
style="@style/text_content_style"
android:text="gaga" /> <TextView style="@style/text_red_content_style"
android:text="guagua" /> </LinearLayout>

引入的样式的.xml

<?xml version="1.0" encoding="utf-8"?>
<resources> <style name="text_content_style">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textColor">#66ff00</item>
<item name="android:textSize">28sp</item>
</style> <style name="text_red_content_style" parent="@style/text_content_style">
<item name="android:textColor">#ff0000</item>
</style>
<style name="activity_bg_theme">
<item name="android:background">#ff0000</item>
<item name="android:windowFullscreen">true</item>
</style> </resources>

android样式跟主题的更多相关文章

  1. Android 样式和主题(style & theme)

    Android 样式 android中的样式和CSS样式作用相似,都是用于为界面元素定义显示风格,它是一个包含一个或者多个view控件属性的集合.如:需要定义字体的颜色和大小. 在CSS中是这样定义的 ...

  2. Android样式和主题

    样式:style--> 主题:theme--> <style name="my_style"> <item name="android:te ...

  3. android 样式和主题

  4. Android 样式 (style) 和主题(theme)

    转载:https://gold.xitu.io/post/58441c48c59e0d0056a30bc2 样式和主题 样式是指为 View 或窗口指定外观和格式的属性集合.样式可以指定高度.填充.字 ...

  5. Android样式(style)和主题(theme)

    样式和主题 样式是指为 View 或窗口指定外观和格式的属性集合.样式可以指定高度.填充.字体颜色.字号.背景色等许多属性. 样式是在与指定布局的 XML 不同的 XML 资源中进行定义. Andro ...

  6. android 学习随笔十九(对话框、样式、主题、国际化 )

    1.对话框 package com.itheima.dialog; import android.os.Bundle; import android.app.Activity; import andr ...

  7. 第三部分:Android 应用程序接口指南---第二节:UI---第十一章 样式和主题

    第11章 样式和主题 style是用于指定View或window的外观和格式的一系列属性的集合.style可以指定高(height).填补(padding).字体颜色.字体大小.背景颜色等等属性.st ...

  8. Android指南 - 样式和主题

    本文翻译自:https://developer.android.com/guide/topics/ui/themes.html Style和theme词汇是专用术语,下文直接使用而不翻译. 样式和主题 ...

  9. Android中样式及主题

    Android应用程序中不可避免的需要使用的样式和主题,样式指定一般指定View的高度.字体.字体颜色.背景,Android里的样荐定义在Style.xml文件里.主题也是一种样式,只不过它是应用在整 ...

随机推荐

  1. undo_retention:确定最优的撤销保留时间

    使用下面的公式来计算undo_retention参数的值: undo_retention=undo size/(db_block_size * undo_block_per_sec) 可以通过提交下面 ...

  2. Landsat8数据不同波段组合的用途

    2013年2月11日发射的Landsat系列最新卫星Landsat8,携带有OLI陆地成像仪和TIRS热红外传感器,Landsat8的OLI陆地成像仪包括9个波段,OLI包括了ETM+传感器所有的波段 ...

  3. 设置高级的Logstash 管道

    设置高级的Logstash 管道: 一个Logstash 管道在很多实用例子有一个或者多个输入,filter,和output 插件. 本节中 创建Logstash 配置文件来指定那些插件和讨论每个插件 ...

  4. Oracle检查与安装操作内容

    Oracle 安装: 检查安装包 rpm -q binutils compat-libstdc++ elfutils-libelf elfutils-libelf-devel elfutils-lib ...

  5. javascript第九课"闭包"

    所谓闭包:就是一个函数内部又定义了一个函数,而这个函数能访问外部函数作用域范围内的变量,这个内部函数就叫做闭包!   js中的面向对象都是使用闭包来实现的 闭包里使用的变量会现在当前函数内搜索,没有的 ...

  6. UIViewController、UINavigationController与UITabBarController的整合使用

    UINavigationController与UITabBarController是iOS开发中最常用的两种视图控制器,它们都属于UIViewController的子类,继承关系如下: @interf ...

  7. where can I find source of com.android.internal.R.styleable.AlertDialog_multiChoiceItemLayout?

    I want to modify Alert dialog multi select layout. For my program I want two line multi-select item. ...

  8. TFS跨版本Merge测试

    原始文件Merge.txt Change Set Dev Beta #1 2014-9-25 10:49:13 ZDK 2014-9-25 10:49:13 ZDK #2 2014-9-25 10:4 ...

  9. EC读书笔记系列之7:条款12 复制对象时勿忘其每一个成分

    记住: ★copying函数应确保复制“对象内的所有成员变量”及“所有base class成分” ★不要尝试以某个copying函数实现另一个copying函数.应该将共同机能放进第三个函数中,并由两 ...

  10. Java提高学习之Object类详解(1)

    转自:http://www.importnew.com/10304.html 问:什么是Object类? 答:Object类存储在java.lang包中,是所有java类(Object类除外)的终极父 ...