我试图使 endIconDrawable 不可见或不可见,它是上图中仅用于名字字段的编辑图标,并且希望保留其余字段的可见编辑图标,但无法做到这一点?我怎样才能做到这一点?
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tilFirstName"
android:layout_width="match_parent"
android:layout_height="@dimen/_64dp"
app:endIconDrawable="@drawable/icon_edit"
app:endIconMode="custom">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/etFirstName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusableInTouchMode="false"
android:hint="@string/label_fname"
android:inputType="textCapWords" />
</com.google.android.material.textfield.TextInputLayout>
Run Code Online (Sandbox Code Playgroud)
我想得到如下图所示的内容:
android android-drawable android-textinputlayout material-components-android
请在以下链接中提供图片。这个带有图标的栏的术语或官方术语是什么?
如何单击每个 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>
Run Code Online (Sandbox Code Playgroud)
那么如何使用 drawbleRight 单独编辑每个字段。请帮忙。
android onclicklistener android-textinputlayout android-textinputedittext material-components-android