gpt4 book ai didi

android - 如何删除 TextInputLayout 可绘制填充?

转载 作者:行者123 更新时间:2023-12-03 21:02:29 26 4
gpt4 key购买 nike

我正在使用 ExitText里面 TextInputLayout并启用``

app:passwordToggleEnabled="true"

并得到 Toggle如下图

enter image description here

我想删除 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com