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>
Select the table cells that you want to add a border to (or change the border of). Select the Table Tools / Design tab on the ribbon. Select one of the following in the Draw Borders group: Use Pen Color to change the color of the border.
Create a FrameLayout that gets the background color of your border, and a margin or padding of your border width, and place that FrameLayout in your RelativeLayout. Place the TextView in your FrameLayout instead of directly in the RelativeLayout. poof instant border. Show activity on this post.
RelativeLayout : is a ViewGroup that displays child views in relative positions. AbsoluteLayout : allows us to specify the exact location of the child views and widgets. TableLayout : is a view that groups its child views into rows and columns. FrameLayout : is a placeholder on screen that is used to display a single ...
To add a border to Android TextView we need to create an XML containing shape as a rectangle file under the drawable's folder and set it as background to the TextView. <stroke> tag is used to set the border width and color.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With