8种机械键盘轴体对比
本人程序员,要买一个写代码的键盘,请问红轴和茶轴怎么选?
简介
当我们新建一个项目的时候,都会给Application或者某些Activity设置theme:1android:theme="@style/AppTheme"
这时就需要我们选择或者自定义一个主题,那每个属性又都是什么含义呢?
来看个例子:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
@color/colorPrimary
@color/colorPrimaryDark
@color/colorAccent
@color/colorWindowBg
@color/colorPrimaryDark
@color/colorText
@color/colorPrimary
@color/colorCheck
@color/colorPrimary
@color/colorText
相关属性说明1.colorPrimary: Toolbar导航栏的底色。
2.colorPrimaryDark:状态栏的底色,注意这里只支持Android5.0以上的手机。
3.textColorPrimary:整个当前Activity的字体的默认颜色。
4.android:windowBackground:当前Activity的窗体颜色。
5.colorAccent:CheckBox,RadioButton,SwitchCompat等控件的点击选中颜色
6.colorControlNormal:CheckBox,RadioButton,SwitchCompat等默认状态的颜色。
7.colorButtonNormal:默认状态下Button按钮的颜色。
8.editTextColor:默认EditView输入框字体的颜色。
特别介绍
下面我们要说的是其他一些和颜色相关的属性,这些属性可能你平时并不常用,但合理运用它们不仅可以使你的界面更加绚丽而且可以达到事半功倍的效果。(再次声明以下属性适用于5.0及其以上系统)
1、colorControlHighlight
colorControlHighlight用于控制所有可点击的View的涟漪效果颜色,以button举例来说
普通状态下的button
现在我们在AppTheme中添加下面这条属性1@color/colorCheck
2、colorButtonNormal
用于控制normal状态下button的颜色(注意和button的background属性的区别,设置colorButtonNormal后button依旧会具有涟漪效果,而设置background就没有涟漪效果了)
设置colorButtonNormal后button的normal状态如下
3、android:navigationBarColor
控制底部导航栏的背景色(注意前边必须有android:),例如:
常用控件颜色属性
EditTextunfocused —— colorControlNormal
focus —— colorAccent
cursor —— colorAccent
text color —— android:textColorPrimary
RadioButtonunselected —— colorControlNormal
selected —— colorAccent
CheckBoxbox unchecked —— colorControlNormal
box checked —— colorAccent
Toolbarbackground —— 布局文件中设置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
ActionBarbackground —— 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
Spinnerindicator (not pressed) —— colorControlNormal
indicator (pressed) —— colorAccent
selected entry text color —— “android:textColorPrimary
SwitchCompatthumb switch off —— colorSwitchThumbNormal
thumb switch on —— colorAccent
track overlay —— colorAccent”