PDA

View Full Version : Hiding Keyboard In ScrollView




loon3y
Oct 27, 2011, 03:10 PM
how can u hide the keyboard when ur in scrollview by touching the background?


i have textfields but i want the user to be able to hide the keyboard while touching the background, I've already implemented the hide on return key but i know customers are going to complain.



ArtOfWarfare
Oct 27, 2011, 03:14 PM
When the background receives a touch, send resignFirstResponder to whichever textfield is the one that the user is currently typing in.

loon3y
Oct 27, 2011, 03:23 PM
When the background receives a touch, send resignFirstResponder to whichever textfield is the one that the user is currently typing in.

would it be something like this?


- (IBAction)backgroundTouch:(id)sender {
[displayText resignFirstResponder];
}

loon3y
Oct 27, 2011, 03:34 PM
would it be something like this?


- (IBAction)backgroundTouch:(id)sender {
[displayText resignFirstResponder];
}




this code didn't work for scroll view, it works for regular view.