阅读更多

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

分隔符

横向:

      android:layout_height="1dip"
      android:background="?android:attr/listDivider" />

纵向:

      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"

更多相关文章

  1. Android预定义样式
  2. Android--Listview横向滑动
  3. 短视频源码,实现文字横向移动效果(跑马灯效果)
  4. 善用Android预定义样式
  5. Android预定义样式
  6. Android预定义样式
  7. android 预定义样式简述
  8. android应用自定义字体
  9. android应用自定义字体

随机推荐

  1. android的intent使用方法 .
  2. Android软件安装工具-APK安装器
  3. Android(安卓)Bitmap 的加载和 Cache 缓
  4. Android应用程序与SurfaceFlinger服务的
  5. android zxing 横屏改为竖屏的配置
  6. 面向 Android(安卓)的 Google 项目:Google
  7. Hello World Kotlin
  8. 进入android项目组的第一天
  9. Handler 机制(一)
  10. Flutter实战(八)---巧用SizedBox实现Margin