如何让UITextView的文字真正消失?
我的程序有一个UITextView,我手动输入并滚动文本:
[myTextView scrollRangeToVisible:NSMakeRange([myTextView.text length]-1, 1)];
输入一定量后文本将消失(如果文本长度> 200) 但是,当我通过 NSLog 输出内容时,文本内容仍然有效,并且每次输入文本时都会更新;它只是不会显示在 myTextView 上
有什么建议吗?
My program has a UITextView and I enter and scroll the text manually:
[myTextView scrollRangeToVisible:NSMakeRange([myTextView.text length]-1, 1)];
The text will disappear after a certain amount of input (if text length > 200)
However, when I output the content via NSLog, the text content is still valid and being updated every time I enter the text; it just won't show on myTextView
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
同样的问题在这里:
我有一个 UIView,我在触摸事件之后在屏幕上进出动画。
该视图有一个 UILabel、一个 UIButton 和一个 UITextView。
不知何故,如果我对它们进行 NSLog,那么 TextViews alpha、text 和 textColor 属性都可以。
编辑:在我尝试在 UITextView 上滚动后,显然文本会重新出现;
Same problem here:
I have a UIView that I animate in and out of the screen following Touch Events.
This View has a UILabel, a UIButton and a UITextView.
Somehow the TextViews alpha, text and textColor attributes are all Ok, if I NSLog them.
EDIT: Appearently the text reappears after I try to scroll at the UITextView;
呃,我不是 i-developer,但是你不能在 UIView 实际上变得不可见之后将 Text 设置为 null 或空字符串吗?我确信该平台允许您在动画中注册“完成回调”,该回调将在动画完成其周期时运行。
Uh, I'm not i-developer, but can't you just set the Text to null or empty-string just after the UIView is actually made invisible? I'm sure that the platform allows you to register a "finished-callback" in the animation, that will run when the animation completes its cycle..