Question

In my page contain a lot of layouts and I want to draw a corner to each layout so I try:

<shape xmlns:android="http://schemas.android.com/apk/res/android">
     <solid android:color="#ffffff"/>
     <corners android:radius="5px"/>
     <stroke  android:width="2dip" android:color="#ababab"/>
     <padding android:left="0dp" 
          android:top="0dp" 
          android:right="0dp" 
          android:bottom="0dp" /> 
</shape>

So color of shape is white but all I want is only a border and use background like the default.

How to set it?

Was it helpful?

Solution

I think this should work. Set color to transparent:

<solid android:color="#00000000"/> 

OTHER TIPS

remove solid from your shape as follows....

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

<corners android:radius="5px"/>
 <stroke  android:width="5dip" android:color="#ababab"/>
<padding android:left="0dp" 
android:top="0dp" 
android:right="0dp" 
android:bottom="0dp" /> 
</shape>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top