Is there an easy way to add a border to the top and bottom of an Android View?
In android 2.2 you could do the following. Create an xml drawable such as /res/drawable/textlines.xml and assign this as a TextView’s background property. <TextView android:text=”My text with lines above and below” android:background=”@drawable/textlines” /> /res/drawable/textlines.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”> … Read more