android - Add only top and bottom border on LinearLayout -


i add bottom , top border on linearlayout. have tried :

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

but add border around shape..

could me please ?

make two file , put this code. can set border top , bottom border,

main.xml

<textview       android:text="this textline"       android:background="@drawable/border_set" /> 

border_set.xml

this file located full path project_root/res/drawable/border_set.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="#ff000000" />             <solid android:color="#ffdddddd" />          </shape>    </item>     <item android:top="1dp" android:bottom="1dp">        <shape          android:shape="rectangle">             <stroke android:width="1dp" android:color="#000" />             <solid android:color="#ffffff" />         </shape>    </item>  </layer-list> 

Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -