字体大小
对于能够显示文字的控件(如TextView EditText RadioButton Button CheckBox Chronometer等等),你有时需要控制字体的大小。Android平台定义了三种字体大小。
"?android:attr/textAppearanceLarge"
"?android:attr/textAppearanceMedium"
"?android:attr/textAppearanceSmall"
使用方法为:
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"
字体颜色
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"
分隔符
横向:
<View android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="?android:attr/listDivider" />
纵向:
<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"
更多细节可参考SDK文档的R.attr类。
分享到:
相关推荐
Android 自定义Spinner样式的 选择框背景,选择框文字属性,弹出框文字属性
android Preference自定义样式
android 自定义RadioButton的样式android 自定义RadioButton的样式
ANDROID内建NFC手机付款应用见月明
android自定义ProgressDialog样式详解,一分钟教会你如何自定义android样式。
这个demo是关于android中继承Dialog重新自定义一个ProgressDialog。 需求:带加载图片和文字说明,可定时停止也可被动中断。 如有BUG或者不完善,欢迎小伙伴们提出~
对于android项目开发来说,常常会用到Spinner实现下拉框的效果。而对于Spinner加载适配器的方法有多种: 1.直接加载android自带的ArrayAdapter,SimpleAdapter; 2.自定义继承BaseAdapter的适配器。 对于适配器加载...
android TextView 支持CSS样式
自定义的 SeekBar 样式,实现很简单,有需要的可以看看,本demo是仿酷狗SeekBar 的样式,进度条上小圆球可以随意拖动,如果不需要小圆球的只需要将main.xml里面的android:thumb="@drawable/seek_thumb"去掉就行了...
android listview 自定义样式实例 可以改造成自己所需风格
各种android弹出dialog效果以及各种dialog样式各种android弹出dialog效果以及各种dialog样式各种android弹出dialog效果以及各种dialog样式各种android弹出dialog效果以及各种dialog样式各种android弹出dialog效果...
AndroidStudio将成为开发Android的主流,如此利器怎能没一款好看的主题样式,这是一款不错主题样式
Android 时间轴样式的demo,样式仅供参考,不可用于商业用途,有问题可以联系我。
Android各种日历样式,最新5.0样式等
android开发进度条的实现样式包括三种(图片,style,动画),研究完成后可以完美解决各种进度条的展示
Android聊天列表样式,使用很简单
今天开发Android短彩信传统模式,遇到了修改tab的默认样式问题,搜集了一些资料,可用参考。
包含所有的Android Layout的样式布局和属性讲解
android用ListView实现表格样式