To add a border to TextView, you need to create an XML file in drawable that sets shape to set the special effect of the text box.
<?xml version= "1.0" encoding= "Utf-8"? ><shape xmlns:android= "Http://schemas.android.com/apk/res/android" > <!--solid-- <solid android:color= "@android: Color/white"/> <!--border --< Stroke android:width= "0.5DP" android:color= "@android: Color/white"/> <!--rounded-up < Corners android:radius= "3DP"/> <!--edge- <padding android:bottom= "5DP" android: left= "5DP" android:right= "5DP" android:top= "5DP"/> <!--gradient- -and <gradient Android:angle= "android:endcolor=" #FFFF782 "android:startcolor=" #13C7AF "/></shape>
basically commonly used in this kind of, to achieve a good effect, need to carefully adjust.
Here's how to set the background for the TextView with this shape.
android:background= "@drawable/border_write"
Effect.
Welcome to AC http://blog.csdn.net/ycwol/article/details/47192651
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android TextView plus border