2017-08-12 39 views

回答

2

試試這個創建帶邊框的EditText

創建borderedEdittext.xml並放入繪製

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

    <!-- Background Color --> 
    <solid android:color="#ffffff" /> 

    <!-- Border Color --> 
    <stroke android:width="1dp" android:color="#ff9900" /> 

    <!-- Round Corners --> 
    <corners android:radius="5dp" /> 

</shape> 

和圖像,並提示使用該

<EditText 
      android:drawableLeft="@drawable/profilePic" 
      android:hint="Enter Name" 
      android:background="@drawable/borderedEdittext" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" />