Reputation: 721
how to change relative layout border color?? this is my code below i just want to show border color black but is show all relative layout black. i just want to show relative layout white color only borde will be black what will i do??
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/border5">
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#000000" />
</shape>
</item>
<item android:left="1dp" android:top="1dp" android:bottom="2dp" >
<shape android:shape="rectangle">
</shape>
</item>
</layer-list>
Upvotes: 5
Views: 15834
Reputation: 44571
This is how I give mine a white background
and orange border
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="@drawable/white" />
<stroke
android:width="3px"
android:color="@drawable/orange" />
</shape>
If you simply just want a border then you can keep it all in the same <shape>
and use <solid...>
for the background
color (if you want to give it one) and <stroke...>
for the border.
You can do it how you have it just change the <solid>
to the background
color you want and add the <stroke>
with black
Upvotes: 18