对于能够显示文字的控件(如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"
分享到:
相关推荐
Android带有文字的progress,文字的颜色随着进度条的提升而渐变
androidstudio字体颜色配置文件,下载后打开AndroidStudio,File-->Import Settings
Android TextView 个别文字字体颜色格式
android listView 改变选中行的 字体颜色和 图片
Android 一个TextView中设置不同字体大小和颜色
android 用shape画出来的颜色做背景时,动态的改变它的颜色属性。
Android中自定义Toast背景颜色及字体颜色,防止Toast多次创建的ToastUtil,详细了解请移步:http://blog.csdn.net/zxc514257857/article/details/68962539
本人封装的一个工具类,可对textview和EditText中的部分字体修改颜色和大小。希望对大家有所帮助! 有四个构造方法,可以改变字体大小和颜色或者默认TextView本身的颜色大小都可以!! 代码中都写又详细的注释!
android实现TextView文字部分渐变色;LinearGradientFontSpan SpannableString
android开发eclipse环境代码字体大小更改和代码自动提示功能基本设置
可以修改一连串字串中某几个字符的颜色,非常好用,大家可以试试
改代码主要是针对listview修改指定item字体颜色
由于项目需求,最近在研究Spinner,发现系统自带的spinner的字体大小和颜色没法修改,于是查找资料实现修改系统自带Spinner字体大小和颜色的功能;并且该demo还实现了自定义Spinner样式以及实现hint的效果,本人第一...
Android 改变界面中的字体颜色,改变Android界面中的字体颜色,点击按钮后,可将文字颜色设置成深灰色和浅灰色,这两行关键代码为: Button button0=(Button)this.findViewById(R.id.Button01);//深灰 Button ...
android 置换文字颜色 改变TextView文字颜色
在切换的时候,Tab下划线跟着手指滑动的比例而滑动,相关的两个Tab的文字的颜色根据手指的滑动,而发生颜色渐变的改变。
可根据颜色查询十六进制,android画图必备
Android 主题切换,切换字体颜色颜色,背景色,图片引用文件等。
极为漂亮的 eclipse字体颜色样式(主题theme)