下面我給出了代碼,在這里我無法理解代碼app:endIconCheckable行的要點,因為無論我設定它的值(真/假)它都沒有顯示和差異,任何人都可以幫助我理解,什么時候不應該使用它?
<com.google.android.material.textfield.TextInputLayout
android:id="@ id/textInputLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="50dp"
android:layout_marginEnd="50dp"
android:hint="@string/foot"
app:counterEnabled="true"
app:counterMaxLength="10"
app:counterTextColor="@color/red_30k"
app:helperText="@string/required"
app:helperTextTextColor="@color/red_30k"
app:endIconMode="custom"
app:endIconDrawable="@drawable/ic_launcher_background"
**app:endIconCheckable="false"**
app:errorEnabled="true"
app:layout_constraintBottom_toTopOf="@ id/textView7"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.textfield.TextInputEditText
android:id="@id/editTextNumber"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="number"
android:maxLength="10" />
</com.google.android.material.textfield.TextInputLayout>
uj5u.com熱心網友回復:
它的作用與setEndIconCheckable()從 Java/Kotlin 呼叫的相同:
將當前結束圖示設定為可檢查或不可檢查。
如果圖示就像按鈕一樣作業,并且它是否被選中并不影響其行為,例如明文結束圖示,則鼓勵呼叫此方法,以便螢屏閱讀器不會宣布圖示的選中狀態。
我希望這主要用于可繪制物件是 aStateListDrawable并且您對選中狀態和正常狀態有不同的圖稿時。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/316696.html
上一篇:更改嵌套節點的值
