zoukankan      html  css  js  c++  java
  • android 字体及颜色

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

    java代码:
    "?android:attr/textAppearanceLarge"
    "?android:attr/textAppearanceMedium"
    "?android:attr/textAppearanceSmall"


           使用方法为:

    java代码:
    android:textAppearance="?android:attr/textAppearanceLarge" 
    android:textAppearance="?android:attr/textAppearanceMedium" 
    android:textAppearance="?android:attr/textAppearanceSmall"

    style="?android:attr/textAppearanceLarge" 
    style="?android:attr/textAppearanceMedium" 
    style="?android:attr/textAppearanceSmall"


    字体颜色

    java代码:
    android:textColor="?android:attr/textColorPrimary" 
    android:textColor="?android:attr/textColorSecondary" 
    android:textColor="?android:attr/textColorTertiary" 
    android:textColor="?android:attr/textColorPrimaryInverse" 
    android:textColor="?android:attr/textColorSecondaryInverse"


    ProgressBar 
    style="?android:attr/progressBarStyleHorizontal" 
    style="?android:attr/progressBarStyleLarge" 
    style="?android:attr/progressBarStyleSmall" 
    style="?android:attr/progressBarStyleSmallTitle"

    分隔符 横向:

    java代码:
    <View 
    android:layout_width="fill_parent" 
    android:layout_height="1dip" 
    android:background="?android:attr/listDivider" />

    纵向:

    java代码:
    <View android:layout_width="1dip" 
    android:layout_height="fill_parent" 
    android:background="?android:attr/listDivider" />

    CheckBox 
    style="?android:attr/starStyle"

    //类似标题栏效果的TextView 
    style="?android:attr/listSeparatorTextViewStyle"

    //其它有用的样式 
    android:layout_height="?android:attr/listPreferredItemHeight"

    android:paddingRight="?android:attr/scrollbarSize"

    style="?android:attr/windowTitleBackgroundStyle"

    style="?android:attr/windowTitleStyle"

    android:layout_height="?android:attr/windowTitleSize"

    android:background="?android:attr/windowBackground"

  • 相关阅读:
    Java多态(更新中...)
    C语言free释放内存后为什么指针里的值不变?竟然还可以输出?
    LeetCode:344-反转字符串
    20150518 字符设备驱动
    20150517 Linux文件系统与设备文件系统
    20150514我读《深入理解linux内核》之虚拟文件系统笔记
    双系统Ubuntu下修复启动项的两种方法
    20150503 imx257下实现I2C驱动的四种方法
    20150502 调试分析之 使用gdb远程调试ARM开发板
    20150501 调试分析之 修改内核来定位系统僵死问题
  • 原文地址:https://www.cnblogs.com/lotusve/p/2541846.html
Copyright © 2011-2022 走看看