• Android 字体和颜色


        对于能够显示文字的控件(如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"
    复制代码
    路漫漫其修远兮 吾将上下而求索
  • 相关阅读:
    APP 弱网测试可能会出现的bug
    Monkey 稳定性测试
    设计模式 策略模式
    设计模式 单例模式
    Linux常用命令(三)文件权限管理
    Linux常用命令(二)文件目录管理命令
    Linux常用命令(一)
    WSL安装yum报错:E: Unable to locate package yum
    使用LxRunOffline迁移WSL
    关于PyQt5 setPalette 设置背景不生效问题
  • 原文地址:https://www.cnblogs.com/hudabing/p/3184027.html
Copyright © 2020-2023  润新知