gpt4 book ai didi

swift - 切换隐藏具有固定点数的 UITextField

转载 作者:行者123 更新时间:2023-11-28 07:23:26 24 4
gpt4 key购买 nike

目前,我正在使用下面的代码,但是文本的最后部分是 ... 而不是 *** 的问题(见图).现在我想隐藏只有六个 * 的文本,例如 ****** 并弄清楚如何解决上述问题。

@objc func hideMoney(){
if isMoneyHide == true{
moneyAmount.isSecureTextEntry = true
}else{
moneyAmount.isSecureTextEntry = false
}
isMoneyHide = !isMoneyHide
}

结果:

enter image description here

enter image description here

提前致谢

最佳答案

解决问题

将最小字体大小设置为小于 UITextField 文本大小

示例:- 如果您的 UITextField 文本大小为 20,则最小字体大小设置为 15

enter image description here

关于swift - 切换隐藏具有固定点数的 UITextField,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57319847/

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