对于能够显示文字的控件(如TextView EditText RadioButton Button CheckBox Chronometer等等),你有时需要控制字体的大小。Android平台定义了三种字体大小。

java代码:

  1. "?android:attr/textAppearanceLarge"
  2. "?android:attr/textAppearanceMedium"
  3. "?android:attr/textAppearanceSmall"

复制代码

使用方法为:

java代码:

  1. android:textAppearance="?android:attr/textAppearanceLarge"
  2. android:textAppearance="?android:attr/textAppearanceMedium"
  3. android:textAppearance="?android:attr/textAppearanceSmall"
  4. style="?android:attr/textAppearanceLarge"
  5. style="?android:attr/textAppearanceMedium"
  6. style="?android:attr/textAppearanceSmall"

复制代码

字体颜色

java代码:

  1. android:textColor="?android:attr/textColorPrimary"
  2. android:textColor="?android:attr/textColorSecondary"
  3. android:textColor="?android:attr/textColorTertiary"
  4. android:textColor="?android:attr/textColorPrimaryInverse"
  5. android:textColor="?android:attr/textColorSecondaryInverse"
  6. ProgressBar
  7. style="?android:attr/progressBarStyleHorizontal"
  8. style="?android:attr/progressBarStyleLarge"
  9. style="?android:attr/progressBarStyleSmall"
  10. style="?android:attr/progressBarStyleSmallTitle"

复制代码

分隔符 横向:

java代码:

  1. <View
  2. android:layout_width="fill_parent"
  3. android:layout_height="1dip"
  4. android:background="?android:attr/listDivider" />

复制代码

纵向:

java代码:

  1. <View android:layout_width="1dip"
  2. android:layout_height="fill_parent"
  3. android:background="?android:attr/listDivider" />
  4. CheckBox
  5. style="?android:attr/starStyle"
  6. //类似标题栏效果的TextView
  7. style="?android:attr/listSeparatorTextViewStyle"
  8. //其它有用的样式
  9. android:layout_height="?android:attr/listPreferredItemHeight"
  10. android:paddingRight="?android:attr/scrollbarSize"
  11. style="?android:attr/windowTitleBackgroundStyle"
  12. style="?android:attr/windowTitleStyle"
  13. android:layout_height="?android:attr/windowTitleSize"
  14. android:background="?android:attr/windowBackground"

复制代码

Android 字体和颜色的更多相关文章

  1. Android 系统字体和颜色样式

    Android 字体和颜色 对于能够显示文字的控件(如TextView EditText RadioButton Button CheckBox Chronometer等等),你有时需要控制字体的大小 ...

  2. Android(java)学习笔记96:如何改变spinner系统自带的字体和颜色

    1.首先我们要知道spinner系统自带字体和颜色本质: 原生的Spring 控件是无法更改字体和颜色的... 从下面的代码可以看出...红色的标注显示使用的是Android默认的布局.. Spinn ...

  3. Android Studio 3.1.2 修改字体(font)大小(size) 及老版本修改主题、字体、颜色 参照地址

    Android Studio 3.1.2  修改字体(font)大小(size) 步骤:File-Settings-Editor-Color Scheme-Color Scheme Font-Size ...

  4. Android(java)学习笔记35:如何改变Spinner系统自带的字体和颜色

    1. 首先我们要知道Spinner系统自带字体和颜色本质: 原生的Spring 控件是无法更改字体和颜色的... 从下面的代码可以看出...红色的标注显示使用的是Android默认的布局.. Spin ...

  5. Java读取word文件,字体,颜色

    在Android读取Word文件时,在网上查看时可以用tm-extractors,但好像没有提到怎么读取Word文档中字体的颜色,字体,上下标等相关的属性.但由于需要,要把doc文档中的内容(字体,下 ...

  6. 使用selector修改TextView中字体的颜色

    selector想必大家都用过了,但是在修改字体的颜色的时候还是要细心. 我们在TextView中设置字体颜色一般使用 android:textColor="@color/red" ...

  7. Android TextView背景颜色与背景图片设置

    Android TextView 背景颜色与背景图片设置,android textview 控件,android textview 背景, android textview 图片,android te ...

  8. java的字体的颜色,型号,大小的方法

    jTextPane1.setForeground(Color.green);//设置java字体的颜色   设置字体的颜色和型号和大小 jTextPane1.setFont(new Font(&quo ...

  9. Javascript动态调整文章的行距、字体、颜色,及打印页面和关闭窗口功能

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

随机推荐

  1. 回顾一年的IT学习历程与大学生活

    今天是2015年8月27日,距离成为大三狗还有一个多星期,在这个不算繁忙的暑假的下午来总结一下这一年来,在IT方面的学习. 一.入门(2014.3) 我大一的专业是信息工程,信息工程听上去就是信息(I ...

  2. 扫描二维码下载安装apk的app

    将apk文件放到服务器上,下载链接直接生成二维码,用微信扫描时不能直接下载.页面只是刷新一下. 想实现微信扫描下载apk的app客户端,需要把下载链接做到一个网页上, 将网页生成一个二维码. 直接下载 ...

  3. php中curl的详细解说

    cURL可以使用URL的语法模拟浏览器来传输数据, 因为它是模拟浏览器,因此它同样支持多种协议, FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE ...

  4. [转载]VS2012编译C语言scanf函数error的解决方法

    在VS 2012 中编译 C 语言项目,如果使用了 scanf 函数,编译时便会提示如下错误: error C4996: 'scanf': This function or variable may ...

  5. [转]Java静态方法为什么不能访问非静态方法

    非静态方法(不带static)可以访问静态方法(带static),但是反过来就不行,为什么呢? ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 publi ...

  6. fluery算法

    #include<stdio.h> #include<string.h> struct stack { int top; ]; }s; ][]; void dfs(int x) ...

  7. Html-Css-iframe的使用

    iframe是作为在网页中嵌套网页的标签 <iframe src="homeIndex_init.html" width="100%" height=&q ...

  8. Java设计模式-状态模式(State)

    核心思想就是:当对象的状态改变时,同时改变其行为,很好理解!就拿QQ来说,有几种状态,在线.隐身.忙碌等,每个状态对应不同的操作,而且你的好友也能看到你的状态,所以,状态模式就两点:1.可以通过改变状 ...

  9. 缓存插件 Spring支持EHCache缓存

    Spring仅仅是提供了对缓存的支持,但它并没有任何的缓存功能的实现,spring使用的是第三方的缓存框架来实现缓存的功能.其中,spring对EHCache提供了很好的支持. 在介绍Spring的缓 ...

  10. 走进科学 WAF(Web Appllication Firewall)

    1. 前言 当WEB应用越来越为丰富的同时,WEB 服务器以其强大的计算能力.处理性能及蕴含的较高价值逐渐成为主要攻击目标.SQL注入.网页篡改.网页挂马等安全事件,频繁发生. 企业等用户一般采用防火 ...