我需要显示UITableView包含用户帐户凭据的内容.对于这一点,我使用UILabels在UITableViewCell.当我显示他们的密码时,我显然只想显示一个占位符密码而不是他们的实际密码,类似于UITextField设置为安全文本输入模式的时候.事实上,我想使用与使用相同的字符UITextField,而不是'*'.
我的问题是,UITextField当它处于安全模式时,密码字符的字符代码是什么?
Sco*_*ner 18
这是一种方法,例如,在原型单元格的detailTextLabel中显示密码"点缀":
// self.password is your password string
NSMutableString *dottedPassword = [NSMutableString new];
for (int i = 0; i < [self.password length]; i++)
{
[dottedPassword appendString:@"?"]; // BLACK CIRCLE Unicode: U+25CF, UTF-8: E2 97 8F
}
cell.detailTextLabel.text = dottedPassword;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9464 次 |
| 最近记录: |