2016-10-03 122 views

回答

-1

創建button_border.xml,並保持它繪製中。

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
android:shape="rectangle"> 

<!-- view border color and width --> 
<stroke 
    android:width="1dp" 
    android:color="@color/white" > 
</stroke> 

<!-- The radius makes the corners rounded --> 
<corners 
    android:radius="2dp" > 
</corners> 

</shape> 

現在你們EDITTEXT背景如下:

android:background="@drawable/button_border" 
+0

這不提供漸變背景。 –

0
  • 添加的EditText在佈局
  • 設置漸變的背景顏色爲佈局
  • 設置的空白1DP爲edittext
  • 設置白色背景的EditText

我認爲現在是顯示像您的期望,謝謝