我正在使用 ExitText
里面 TextInputLayout
并启用``
app:passwordToggleEnabled="true"
并得到
Toggle
如下图我想删除
toggle
的右填充但不知何故不能。我都设置好了
0dp
,但没有成功。<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:passwordToggleEnabled="true"
android:layout_margin="0dp"
android:padding="0dp">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="0dp"
android:layout_margin="0dp"
android:drawablePadding="0dp"/>
</com.google.android.material.textfield.TextInputLayout>
有一些幼稚的解决方案,例如设置负边距,但由于我不知道填充的大小,我也不能这样做。有什么建议吗?
最佳答案
您也可以使用此代码
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:passwordToggleEnabled="true">
<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content" android:inputType="textPassword"/>
</android.support.design.widget.TextInputLayout>
关于android - 如何删除 TextInputLayout 可绘制填充?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56391991/