1.在res下的drawble文件夹下新建文件,textview_border.xml:
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <solid android:color="#ffffff" /> <stroke android:width="3dip" android:color="#4fa5d5"/> </shape>
2.在textView中指定background:
android:background="@drawable/textview_border"