UITextField文本在每次其他击键时都会消失 [英] UITextField text disappears on every other keystroke

查看:167
本文介绍了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天全站免登陆