0

How to add border on Layouts in Android

[code langauage=”xml”]

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape
android:shape="rectangle">
<stroke android:width="1dp" android:color="#33ffffff" />
<solid android:color="#33ffffff" />

</shape>
</item>

<item android:top="1dp" android:bottom="1dp">
<shape
android:shape="rectangle">
<stroke android:width="1dp" android:color="#33ffffff" />
<solid android:color="#33ffffff" />
</shape>
</item>

</layer-list>

[/code]

then add this to linear layout as backgound as this:

[code langauage=”java”] android:background="@drawable/border"[/code]

Sandeep Kumar

Sandeep kumar is a web developer and a professinal blogger. He works for latest technologies and write articles what he learn. In ICodeHub he share web languages tutorials and other programming tips and tricks. if you need some help or have some suggestion then mail him at sandeep92pal@gmail.com without any hesitation. He believes in learning and sharing.