对于能够显示文字的控件(如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"

转自:

http://apps.hi.baidu.com/share/detail/3106831

2

更多相关文章

  1. android 预定义样式简述
  2. android应用自定义字体
  3. android应用自定义字体
  4. android预定义样式简述
  5. Android之开源中国UI库(持续更新)
  6. android应用自定义字体
  7. Android新增AppCompatTextView自适应字体大小和文本宽度
  8. TextView 学习
  9. Android预定义样式

随机推荐

  1. xp下android开发环境建立
  2. Android多级树形菜单的实现
  3. Android(安卓)占位符 %1$s %1$d
  4. Android(安卓)ApiDemo(十二)-- Graphics2
  5. Deepin/Ubuntu/Ubuntukylin/Xubunt/Lubun
  6. android之wifi移植全过程
  7. Android(安卓)打包, 不同渠道使用 不同的
  8. Android23_网络存储之HttpClient
  9. MPAndroidChart项目实战——MarkerView显
  10. android在armv4t中跑