gpt4 book ai didi

ios - UITextView隐藏文本

转载 作者:行者123 更新时间:2023-11-29 04:08:45 24 4
gpt4 key购买 nike

我想知道是否可以隐藏 UITextView 中文本中的特定单词或表达式。例如:

UITextView* txt = @"hello how are you"

有没有办法隐藏“你”,使其对用户不可见(考虑到用户无法编辑txt,但仍然是文本的一部分,这样我就可以做txt.text)获取 ehole 字符串?

最佳答案

从 iOS 6.0 开始,UITextView 可以与 NSAttributedStrings 一起使用(请参阅 attributedText property )并使用属性字符串,您可以将颜色更改为透明(或隐藏)。不过,它仍然是可选的,并且可能会在突出显示时显示。

由于最后一句话,我不确定这是否是您想要的。

您还可能会找到一些有用的提示in this related question .

关于ios - UITextView隐藏文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14761478/

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