【发布时间】:2020-06-29 06:27:35
【问题描述】:
如何点击每个TextInputEditText的drawableRight编辑图像?我想单击编辑图标,然后启用编辑每个字段。我该怎么做?
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!--First name-->
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="@dimen/_64dp">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/etFirstName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusableInTouchMode="true"
android:drawableRight="@drawable/icon_edit"
android:hint="@string/label_fname"
android:inputType="textCapWords" />
</com.google.android.material.textfield.TextInputLayout>
<!--Middle name-->
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/activity_registration_tiMiddleName"
android:layout_width="match_parent"
android:layout_height="@dimen/_64dp">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/etMiddleName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusableInTouchMode="true"
android:drawableRight="@drawable/icon_edit"
android:hint="@string/label_mname"
android:inputType="textCapWords"/>
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
那么如何使用 drawbleRight 单独编辑每个字段。请帮忙。
【问题讨论】:
标签: android onclicklistener android-textinputlayout material-components-android android-textinputedittext