最近Material Design Components更新至了1.1.0,其中TextInputLayout新增了不少功能,要怎麼確切使用可以看這篇TextInputLayout,版本記得升級到1.1.0。
今天要記錄的是輸入框末端有一個叉叉圖案,點擊下去,輸入框的文字皆會被清空的效果。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<com.google.android.material.textfield.TextInputLayout | |
... | |
app:endIconMode="clear_text"> |