字体大小

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

更多相关文章

  1. 【转】Android字体小结
  2. Android TextView 中如何使用第三方字体
  3. Android状态栏黑色字体
  4. 修改Android Studio的字体
  5. Android 系统字体和颜色样式

随机推荐

  1. android media player 状态机
  2. Android PATH类动态绘制
  3. Android应用.国际化-屏幕适配-样式与主题
  4. android中PhoneWindow、DecorView
  5. android设置保持窗口常亮
  6. 关闭程序
  7. Android Native Development Kit (NDK)
  8. Version Code 版本设置
  9. Android 滑动开关控件
  10. Android MediaPlayer