Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前正在开发 android 项目,我想允许用户通过选择一个复选框在屏幕上隐藏或显示他们的密码。
我将如何用 * 字符替换字符串中的每个字符,或者是否有特定的方法可以做到这一点。
例如,如果密码是my_password我希望将其替换为***********.
my_password
***********
您可以在 TextView 上使用setTransformationMethod和PasswordTransformationMethod来显示星星。