3

In my application I have textfield and while inserting any values in it it is displaying according values to the tableview as the no. of rows.

I want that when I scroll on the Tableview with having so many filled rows ,the keyboard must be hidden at the time of scrolling.

I have search on the net,but unable to find out the solution.

please give any solution with code snippet or valuable link or any solution.

Thanks, Mishal Shah

Chathuranga Chandrasekara
  • 20,548
  • 30
  • 97
  • 138
Developer
  • 1,009
  • 8
  • 25
  • 56

3 Answers3

8

In your table controller, add this:

- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
    [myTextField resignFirstResponder];
}
Zoran Simic
  • 10,293
  • 6
  • 33
  • 35
1

Just write this code where you want to hide the keyboard. With this code there is no need to do resignFirstResponder.

[self.view endEditing:YES];

Njoy.. :)

NiKKi
  • 3,296
  • 3
  • 29
  • 39
1

Generally, [myTextField resignFirstResponder] puts the keyboard modal view away. Depending on how you have set up handling scrolling, this should be enough to answer your question.

Alex Reynolds
  • 95,983
  • 54
  • 240
  • 345