Java android中的密码编辑文本
有人能告诉我一个密码来实现密码的第二次编辑吗Java android中的密码编辑文本,java,android,xml,android-edittext,android-textinputlayout,Java,Android,Xml,Android Edittext,Android Textinputlayout,有人能告诉我一个密码来实现密码的第二次编辑吗 这是使用材料设计: <com.google.android.material.textfield.TextInputLayout style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense" android:layout_width="match_parent" android:layout_h
这是使用材料设计:
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/login_pwd"
app:endIconMode="password_toggle"
app:errorEnabled="true"
app:startIconDrawable="@drawable/ic_lock">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/etLoginClave"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>
您可以使用以下内容:
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
app:boxBackgroundColor="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:placeholderText="Password"
app:expandedHintEnabled="false"
app:endIconMode="password_toggle"
>
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="textPassword"
/>
</com.google.android.material.textfield.TextInputLayout>
使用
app:expandedHintEnabled=“false”
在文本字段为空时也显示占位符。嘿,thnx先生,这项工作做得很好,剩下的唯一一件事是提示不像edittext视图中的提示那样放置,我也尝试过修改提示的大小,但它不起作用,这是结果嘿,谢谢你先生的帮助,结果与第一条评论相同,我添加了一个屏幕截图的链接,你能在那里发布一些文本填充的编辑文本,让我们看看你希望看到什么?我有点不知道你到底想要什么