How to hide the keyboard when using TableView in Iphone?

In my application, I have a text field, and when I insert any values ​​into it, it displays the corresponding values ​​in the tableview as there is none. lines.

I want the keyboard to be hidden while scrolling in a Tableview with so many rows filled in.

I have a network search but cannot find a solution.

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

Thank you, Mishal Shah

+3
source share
3 answers

In the table controller, add the following:

- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
    [myTextField resignFirstResponder];
}
+8
source

, [myTextField resignFirstResponder] . , , , .

+1

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

[self.view endEditing: YES];

Njoy .. :)

+1
source

Source: https://habr.com/ru/post/1718150/


All Articles