Questions tagged [resignfirstresponder]

A UIResponder method added for handling remote-control events. for iOS 4 and iOS4+

When the user taps a control that can accept first responder status, that control is sent the becomeFirstResponder message. Until another control becomes the first responder or the current control is sent the resignFirstResponder message, that control will keep this status and receive keyboard and shake input.

170 questions
49
votes
14 answers

UITableView reloadData automatically calls resignFirstResponder

I have this UITableView with custom cells that can get only predefined values, therefore I use a UIPickerView as their inputView. All is jolly good until I edit a field and need to show its updated value. In order to make things clearer and easier…
Morpheu5
  • 2,610
  • 6
  • 39
  • 72
17
votes
6 answers

iPhone: Hide Keyboard on App Did Enter Background or View Did Disappear

I have a UISearchBar which when clicked, shows the keyboard. However if the user presses the home button while the keyboard is shown and then goes back into the app, the keyboard is still visible. How can I hide th keyboard when the app…
Dave
  • 783
  • 3
  • 15
  • 25
16
votes
6 answers

UITextField's keyboard won't dismiss. No, really

I have a table view in a modal form sheet (iPad), and one of the cells contains a UITextField. My view controller holds a reference to the text field and is also its delegate. When the text field hits Return, I tell it to -resignFirstResponder…
Ben Zotto
  • 70,108
  • 23
  • 141
  • 204
15
votes
3 answers

Why is UITextField animating on resignFirstResponder?

Since iOS 8, UITextFields in a form behave very strangely. If I click an another text field or press Tab on the keyboard, the entered text animates upwards then reappears quickly. It happens every time after the view did loaded, and every now and…
gklka
  • 2,459
  • 1
  • 26
  • 53
14
votes
13 answers

Resigning First Responder for multiple UITextFields

There is an application in which I am generating multiple UITextFields dynamically. I want to resign first responder whenever the UITextFields are not selected (touch outside the UITextField). How can I know that of which UITextField I have to…
Kritanshu_iDev
  • 454
  • 1
  • 6
  • 8
13
votes
4 answers

Keeping object on top of keyboard in the event of becomeFirstResponder or resignFirstResponder?

I currently have a UITextField on top of a keyboard. When you tap it, it should stick on top of the keyboard and move up smoothly. I don't know the exact duration and animation type of the keyboard, so it's really bumpy. Here's what I…
13
votes
5 answers

IPad dismiss Keyboard without knowing which Textfield opened it

Is there a way to do a general resignFirstResponder to hide the keyboard regardless of what textfield/view/etc calls it? Reason is I have a lot of textfields on my view and don't want to have to resignFirstResponder for all textfields to hide the…
13
votes
9 answers

ResignFirstResponder not working

-(IBAction)settings:(id)sender { [mileagerate resignFirstResponder]; [mainView bringSubviewToFront:mileageView]; mainView.hidden=TRUE; [UIView beginAnimations:@"Settings" context:nil]; [UIView setAnimationDuration:1.0]; …
Sharanya
  • 311
  • 1
  • 2
  • 10
10
votes
4 answers

SwiftUI dismiss keyboard when tapping segmentedControl

I have a TextField in SwiftUI that needs to use a different keyboard depending on the value of a @State variable determined by a SegementedControl() picker. How can I dismiss the keyboard (like send an endEditing event) when the user taps a…
Stewart Lynch
  • 875
  • 9
  • 26
10
votes
5 answers

resign first responder UITextfield

I am so sorry to post this, since it has been asked a million of times, but whenever i try to use one of the solutions, it is either outdated, or won't work with my code. (or maybe i am just doing it wrong) i have 5 textfields and a textview, that…
Peter Boesen
  • 145
  • 1
  • 1
  • 9
9
votes
4 answers

UITextField's resignFirstResponder is not working neither working self.view.endEditing()

I'm facing a ridiculous problem for textField, I have two textfield, namely tfA and tfB, I have set delegates and all for those textfields, what i wanted is, if I click on tfA then it should print something, and it is printing and if I click tfB it…
Abhishek Mitra
  • 3,335
  • 4
  • 25
  • 46
9
votes
3 answers

IOS 7 UITextField resignFirstResponder BAD

Im getting a crash, when using a UItextField, inside my customCell, and when i resignFirstResponder the textfield, but its not visible anymore(the table view scrolled out of window). I still can find the textfield, the pointer continues accessible,…
darkman
  • 993
  • 3
  • 13
  • 31
8
votes
1 answer

Live resizing of UITableViewCell without using reloadData?

First of all, forgive me if the answer is already out there (I honestly have been working and searching for about two weeks). And now, the situation: I have a UITextView as a subview of a UITableViewCell in a UITableView. The UITextView is the first…
Cashew
  • 1,466
  • 2
  • 16
  • 21
7
votes
2 answers

Why is resignFirstResponder being called twice in iOS 5.0 but only once in iOS4.2-4.3?

I have a app in the App Store compiled for 4.2 that is acting odd when running under iOS 5.0. I have tracked it down to resignFirstResponder being called twice under iOS 5.0 while it was only being called once under iOS 4.2 & 4.3. I have a derived…
mmorris
  • 4,006
  • 3
  • 27
  • 29
6
votes
1 answer

UITextField textColor reverts after resignFirstResponder

I have a UIButton that controls the textColor of a UITextField, and I have found that when I call resignFirstResponder on the UITextField, any changes to the textColor made while the text field was first responder are lost, and the color is reverted…
cbosborn
  • 83
  • 1
  • 5
1
2 3
11 12