使用形状绘制为我的背景XML [英] Using shape drawable as my background xml
本文介绍了使用形状绘制为我的背景XML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我真的AP preciate,如果有人可以帮助我使用了如何使用形状绘制作为我的背景XML为我的看法。
I really appreciate if someone can help me with using how to use shape drawable as my background xml for my view.
这是我的尝试: 但我从来没有得到的颜色。机器人总是给我黑色文本白色背景上,我把不管什么颜色的属性。
This is what I tried: But I never get the color. Android always gives me black text on white background, regardless what color attribute I put.
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke android:width="1dip" android:color="#FBBB" />
<solid android:color="#6000"/>
</shape>
我试过了,也不行
I tried , does not work
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
android:color="#6000>
</shape>
我试过了,也不行
I tried , does not work
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
android:background="#6000>
</shape>
我谷歌,这是有限的结果,我发现去尝试。
I google this is the limited result I found to try.
推荐答案
您有错误的颜色设置,您必须指定4个字节的颜色,例如:#ffff8080
You have wrong color settings, you must specify 4 byte colors, eg: #ffff8080
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#f0600000"/>
<stroke android:width="3dp" android:color="#ffff8080"/>
<corners android:radius="3dp" />
<padding android:left="10dp" android:top="10dp"
android:right="10dp" android:bottom="10dp" />
</shape>
这篇关于使用形状绘制为我的背景XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文