IPad Dismiss Keyboard event handling
Pressing the dismiss keyboard button (in the lower right开发者_如何转开发 of the keyboard) is not calling method:
- (BOOL)textFieldShouldReturn:(UITextField *)textField
How can I handle this event and how do I differentiate it from other events (if it's handled by an aggregate event handler)?
Are you setting the delegate
for the textfield? Fix in Interface Builder, or in code; e.g.:
self.TEXTFIELDNAME.delegate = self;
See this post too, should help.
You can listen for keyboard hide UIKeyboardWillHideNotification notification.
Example code is here http://developer.apple.com/iphone/library/samplecode/KeyboardAccessory/Listings/Classes_ViewController_m.html
Or even you can implement method
-(void)textFieldDidEndEditing:(UITextField *)textField
精彩评论