Android Club – How to set border for TextView?

Create resource file inside res/drawable. Name it shape_border.xml:

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
   <solid android:color="#ffffff" />
   <stroke android:width="1dip" android:color="#4fa5d5"/>
</shape>

In your TextView, use this shape:

<TextView android:text="Some text" android:background="@drawable/back"/>