tags:

views:

99

answers:

3

I want to have a elmenent with a 2 color border outline. I can do a single color outline using the element, but this only allows me to draw a single line. I tried using 2 elements within my but that didnt work either. Is there a way to either draw a shape within a shape or draw 2 lines around my shape (which has rounded corners btw).

Thanks Ben

A: 

so i have a work around but its ugly. the work around is to wrap my element inside another container element. i.e.

<RelativeLayout ... android:background="@drawable/outer"> <ListView ... android:background="@drawable/inner" /> </RelativeLayout>

Ben
A: 

One way (and possibly the best way ultimately) to get your layout to look exactly how you want it, is to use paint, photoshop, gimp, or any other drawing program to create the views by hand and then add them to your project's drawable folder. this more or less what you will have to do for most complex graphics you want to design. Once you have drawn them, you can set your element's background to the drawable resource.

Hope this was helpful

mtmurdock
I respectfully disagree. I think the layer-list works quite nicely... thanks though...
Ben
A: 

I found that the <layer-list> is the best approach. like this:

<?xml version="1.0" encoding="utf-8"?>

    </shape>
</item>  
<item android:right="8dip" android:left="8dip" android:bottom="1dip"
    android:top="1dip">
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle">
        <corners android:bottomRightRadius="2dip"
            android:bottomLeftRadius="2dip" android:topLeftRadius="2dip"
            android:topRightRadius="2dip" />
        <solid android:color="@android:color/white" />

        <stroke android:width="1dip" android:color="#BDBDBD" />
    </shape>
</item>

you then need to put the proper margins on your listview row layout, but it works quite nicely.

Ben