UITextField 文本在每隔一个击键时消失 [英] UITextField text disappears on every other keystroke

查看:18
本文介绍了UITextField 文本在每隔一个击键时消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是现象的视频:http://youtu.be/c0TP8YVF9TE

如视频所示,exampleTextView.text 中的值没有丢失.它只是隐藏了所有其他按键.

As the video shows, the value in exampleTextView.text is not lost. Its just hidden every other keystroke.

尝试的解决方案:我不会在程序期间将 exampleTextView.text 值设置为某些值,除非在按下返回键之后(并且注释该行没有任何改变).

Solutions tried: I do not set the exampleTextView.text value to something during the program, except after the return key is pressed (and commenting that line out changes nothing).

我已经设置:

self.exampleTextView.clearsOnBeginEditing=NO;
self.exampleTextView.clearsContextBeforeDrawing=NO;
self.exampleTextView.clearsOnInsertion=NO;

这是我的代码:https://gist.github.com/andrewschreiber/6970283

推荐答案

我遇到了几乎同样的问题.有时文字会消失.

I had almost the same problem. Sometimes the text was disappearing.

我在xib文件中改变了UITextField在视图层次结构中的位置后解决了.

I solved it after changing the position of the UITextField in the view hierarchy in the xib file.

这篇关于UITextField 文本在每隔一个击键时消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆