Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
356 views
in Technique[技术] by (71.8m points)

iphone - UITextField text disappears on every other keystroke

Here is a video of the phenomena: http://youtu.be/c0TP8YVF9TE

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

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).

I have set:

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

Edit: Here is my code: https://gist.github.com/andrewschreiber/6970283

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

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

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...