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 resign first responder? Please specify any other way beyond the 'tag' concept because I have tried that. Please suggest the right direction. Thanks in advance.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
Don't call
resignFirstResponder
; callendEditing:
!Call
endEditing:
on any view above the text fields in the view hierarchy. It will locate the first responder and ask it to resign. UseendEditing:YES
to force it orendEditing:NO
to let the text field's delegate decide if it should end editing (useful if you are validating input).you can check with
isFirstResponder
. At any point of time only oneUIResponder
(UITextField
in your case) can befirstResonder
.This worked for me in Xamarin.iOS / Monotouch. Change the keyboard button to Next, pass the control to the next UITextField and hide the keyboard after the last UITextField.
Inside the ViewDidLoad you'll have:
If your TextFields haven't a Tag set it now:
and just the call
You can try it like this:
I didn't try it but it seems a good solution
I had a problem in Resigning first responder for the selected UITextField from the multiple TextField. I find out this is working for me after so many different solutions.
use this code and implement