tags:

views:

5761

answers:

1

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.

A: 

You have wrong color settings, you must specify 4 byte colors, eg: #ffff8080

<shape xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    <solid android:color="#f0600000"/>
    <stroke android:width="3dp" color="#ffff8080"/>
    <corners android:radius="3dp" />
    <padding android:left="10dp" android:top="10dp"
        android:right="10dp" android:bottom="10dp" />
</shape>
Lucas S.
My 1.5 SDK works great with 3 or 4 chars color codes
Vitaly Polonetsky