答案 0 :(得分:0)
您可以向TextInputEditText
添加一个可绘制图形,如:
<android.support.design.widget.TextInputLayout
android:id="@+id/til_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:boxBackgroundMode="outline"
android:layout_margin="10dp">
<android.support.design.widget.TextInputEditText
android:id="@+id/tiet_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableRight="@drawable/icon"//add the right drawable
android:inputType="textPassword"/>
</android.support.design.widget.TextInputLayout>
答案 1 :(得分:0)
为我工作
<com.google.android.material.textfield.TextInputLayout
...
app:endIconDrawable="@drawable/ic_close_gray_24dp"
app:endIconMode="custom">