对于能够显示文字的控件(如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. 关于一个每天请求50W次接口的设计实现过程

    从大学开始关注博客园,到工作之后注册了博客园账号,直至今日终于能够静下心来将自己个人的所学,所得,所悟能够分享出来与大家分享,好开心~ 言归正传,需求背景是博主所在的公司为一个在线OTA公司,客户端上 ...

  2. 数据结构之链表C语言实现以及使用场景分析

    牢骚:本篇博客两个星期前已经存为草稿,鉴于发生一些糟糕的事情,今天才基本完成.本人6月份应届毕业生一枚,毕业后当天来到帝都,之后也非常顺利,面试了俩家公司都成功了.一家做C++方面电商ERP,一家做w ...

  3. 关于python中PIL的安装

    python 的PIL安装是一件很蛋痛的事, 如果你要在python 中使用图型程序那怕只是将个图片从二进制流中存盘(例如使用Scrapy 爬网存图),那么都会使用到 PIL 这库,而这个库是出名的难 ...

  4. php 读取文件的几种方法

    文件操作的三个步骤,打开,操作,关闭.$fopen=fopen(路径,方式),fwrite($fopen,写入的字符串);fclose($fopen). 其中打开方式有如下几种方式: 模式 描述 r ...

  5. ThinkPHP之MVC与URL访问

    一.初探 我们在apache的www目录下创建一个文件夹,其命名为我们的应用名.然后通过入口文件生成我们的应用. 当我们用ThinkPHP创建好一个应用后,其目录结果如下所示 那么我们如何来访问我们应 ...

  6. java操作xml

    package com.xml.zh; import javax.xml.parsers.*; import org.w3c.dom.*; public class XmlTest1{ /** * 使 ...

  7. simple-LDAP-auth

    <?php /** * simple class for LDAP authentification * Copyright (C) 2013 Petr Palas This program i ...

  8. 基本的mediaQuery写法,不复习又忘记了

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/ ...

  9. requirejs

    //index.html <!doctype html> <html> <head> <meta charset="utf-8"> ...

  10. shiro 与 web 的结合

    本次使用的jar包为 shiro-core-.jar shiro-web-.jar 从Shiro 1.2开始引入了Environment/WebEnvironment的概念,即由它们的实现提供相应的S ...