2010年4月9日金曜日

Dismissing the Keyboard

There are a lot of solutions and ways for dismissing the keyboard and I found
this two functions enough for my applications.

1. Add the UITextFieldDelegate and the UITextField



Don't forget the synthesize MyTextField in your implementation file.
Of course, wire the MyTextField in Interface Builder.

2. Add UITextField delegate callback listener and change the return key to "Done"



3. Add this function anywhere in your ViewController implementation file



4. To dismiss the keyboard when the user clicks outside the textbox, add the code below. This is one of the best solution I've seen on the WEB.



Enjoy!

0 件のコメント:

コメントを投稿