2012-03-19 69 views
0

我正在为我的布局添加边界,但不允许我定义白色或黑色以外的颜色。奇怪的!这是资源文件夹中boundary.xml的代码片段。无法在笔画对象中使用白色或黑色以外的颜色

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
android:shape="rectangle" > 

<stroke 
    android:width="2dip" 
    android:color="@android:color/white" /> 

</shape> 

回答

0

可以在colors.xml定义自己的颜色,然后在你的绘制使用它们作为@color/mycolor 您也可以直接使用颜色代码为Android:颜色属性,如#F00,#4F00(含Alpha通道),#FF0000或#44FF0000(再次,具有Alpha通道)的颜色

android:color="#FF00FF00" 
0

尝试十六进制值使用价值.. 或者像这样设置

android:color="#FF0000" 
0

使用自定义颜色,首先存储在colors.xml文件中的值,然后让这些

相关问题