Android系统颜色的适用范围

情到浓时终转凉″ 提交于 2019-12-01 17:54:00

###All Clickable Views:

  • ripple effect (Lollipop only) — “colorControlHighlight”

###Status Bar:

  • background (Lollipop only) – “colorPrimaryDark”

###Navigation Bar:

  • background (Lollipop only) – “android:navigationBarColor”

###EditText:

  • underline (unfocused) — “colorControlNormal”
  • underline overlay (focus) — “colorAccent”
  • cursor — “colorAccent”
  • text color — “android:textColorPrimary”

###TextView:

  • text color — “android:textColorPrimary”

###CheckBox:

  • box unchecked — “colorControlNormal”
  • box checked — “colorAccent”

###RadioButton:

  • unselected — “colorControlNormal”
  • selected — “colorAccent”
  • ripple effect (Lollipop only) — “colorControlHighlight”

###SwitchCompat:

  • thumb switch off — “colorSwitchThumbNormal”
  • thumb switch on — “colorAccent”
  • track overlay (when switched on) — “colorAccent”

###Spinner:

  • indicator (not pressed) — “colorControlNormal”
  • indicator (pressed) — “colorAccent”
  • selected entry text color (Lollipop only) — “android:textColorPrimary”

###Button:

  • background — “colorButtonNormal”
  • text color — “android:textColorPrimary”

###ActionBar:

  • background — “colorPrimary”
  • title color — “android:textColorPrimary”
  • overflow icon — “android:textColorPrimary”
  • up button — “android:textColorPrimary”
  • action icons — “android:textColorPrimary” †
  • overflow menu background — “android:colorBackground”
  • overflow text color — “android:textColorPrimary”

###Toolbar (Theme Overlay should be used):

  • background — must be set manually in XML. Can do (android:background=”?attr/colorPrimary”)
  • overflow icon — “android:textColorPrimary”
  • navigation icon — “android:textColorPrimary” †
  • action icons — “android:textColorPrimary” †
  • overflow menu background — “android:colorBackground”
  • overflow text color — “android:textColorPrimary”
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!