简单说类似与自定义控件,只不过自定义控件针对的是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. 《零基础学习Python》01

    前言 Python是一种跨平台的语言 安装Python(Mac OS X) 1.在www.python.org/downloads 中下载Python,然后像安装其他软件一样进行安装. 2.打开: 找 ...

  2. android模块

    网络模块 1.URL --------openStream() return InputStream --------openConnection() return URLConnection 2.U ...

  3. Webbrowser中模拟连接点击(非鼠标模拟)

    Delphi uses mshtml, ActiveX; //初始加载网易主页 procedure TForm1.FormCreate(Sender: TObject); begin Webbrows ...

  4. Keli Linux与网络安全(2)——初探Keli

    Kali是BackTrack的升级换代产品,按照官方网站的定义,Kali Linux是一个高级渗透测试和安全审计Linux发行版.作为使用者,我简单的把它理解为,一个特殊的Linux发行版,集成了精心 ...

  5. xrdp的rdp前端无法连接Windows 2008的问题

    xrdp使用rdp前端,无法连接2008,但连接2003是可以的.连接2008的时候,会在客户端发送Client Info PDU后主动RST掉连接.如下图 开始以为是客户端发送Client Info ...

  6. 克拉夫斯曼高端定制 刘霞---【YBC中国国际青年创业计划】

    克拉夫斯曼高端定制 刘霞---[YBC中国国际青年创业计划] 克拉夫斯曼高端定制 刘霞

  7. Android 弹出通知Toast的使用

    //官方帮助文档:http://wear.techbrood.com/guide/topics/ui/notifiers/toasts.html <LinearLayout xmlns:andr ...

  8. Risk(最短路)

    Risk Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 2915   Accepted: 1352 Description ...

  9. leetCode 31.Next Permutation (下一个字典序排序) 解题思路和方法

    Next Permutation  Implement next permutation, which rearranges numbers into the lexicographically ne ...

  10. 当PullToRefreshScrollView里面嵌套ListView

    当PullToRefreshScrollView里面嵌套ListView,ListView上面还是有内容的,当下拉刷新的 时候,数据填充完成之后ListView就会往上面滑动,导致ListView上面 ...