Update 颜色.md
This commit is contained in:
@@ -57,7 +57,8 @@ RGB 从0x00到0xff表示颜色从浅到深。
|
|||||||
int color = getResources().getColor(R.color.mycolor);
|
int color = getResources().getColor(R.color.mycolor);
|
||||||
```
|
```
|
||||||
#### 2.在其他xml文件(layout或style)中引用或者直接创建
|
#### 2.在其他xml文件(layout或style)中引用或者直接创建
|
||||||
```
|
``` xml
|
||||||
|
<!--在style文件中引用-->
|
||||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||||
<item name="colorPrimary">@color/red</item>
|
<item name="colorPrimary">@color/red</item>
|
||||||
</style>
|
</style>
|
||||||
@@ -68,4 +69,6 @@ RGB 从0x00到0xff表示颜色从浅到深。
|
|||||||
android:background="#ff0000" //创建颜色
|
android:background="#ff0000" //创建颜色
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 三.取色工具
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user