views:

66

answers:

3

Hello,

I am moving my view when a text field is pressed in order to get proper view when keyboard appears. Now, when DONE key is presses I would like to return view to its initial state but, how to handle an action when done key is pressed?? Thanks

+3  A: 

make an IBAction as an IBOutlet, and connect it to the text field's didEndOnExit method

jrtc27
A: 

The proper way to do this is to observe to the notifications UIKeyboardDidShowNotification and UIKeyboardDidHideNotification as detailed in Apple's documentation.

If you want to know when the Done button has been pressed, implement

- (BOOL)textFieldShouldReturn:(UITextField *)textField

In your delegate. It should be called when the return button is pressed. See API documentation for more details.

freespace
A: 

Thank you for your comments, I already solved handling didEndOnExit textbox method! Thanks again

Ruthy
could you please mark my answer as correct then, as it gives me rep and boosts your accept % rate?Thanksjrtc27
jrtc27