Closed ajf-sp closed 6 years ago
@hackiftekhar I'm also having similar issue. When I use two actions(Next and Done) on my numberpad textfield, I see one action(Next) so I decided to disable IQKeyboardManager
but it doesn't work with the following code.
IQKeyboardManager.sharedManager().enable = false
I tried above code in AppDelegate
UIToolbar *toolBarView = [[UIToolbar alloc] init];
[toolBarView sizeToFit];
UIBarButtonItem *flexibleSpaceBtn = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:
UIBarButtonSystemItemFlexibleSpace
target:self
action:nil];
UIBarButtonItem *nextBtn = [[UIBarButtonItem alloc] initWithTitle:@"Next" style:UIBarButtonItemStylePlain target:self action:@selector(nextClicked:)];
UIBarButtonItem *doneBtn = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleDone target:self action:@selector(doneClicked:)];
toolBarView.tintColor = [UIColor blackColor];
toolBarView.items = @[doneBtn,flexibleSpaceBtn,nextBtn];
self.dobTF.inputAccessoryView = toolBarView;
is this because of the library its not working?
I'm not sure @ajf-sp @meet2011 but this should work. If not then can you please share a demo with me?
Hi @hackiftekhar thanks for responding. This is related to the other issue I reported. IQKeyboard is unable to find next/previous fields even if I try to add manually. Instead of proceeding to next/previous, the keyboard is dismissed.
So now I try to manually handle my keyboard by disabling IQKeyboardManager and assigning my own UIToolbar. But it still interferes with my view, calling textFieldShouldBeginEditing
twice, and dismissing the keyboard when i call becomeFirstResponder on the next textfield.
I have disabled IQKeyboard in the past version (I was using 4.0.3 i think) but now, it doesn't work.
Can you please share a demo project demonstrating you disabled library and it doesn't work. Could you please confirm it's not the same issue as other issue you are referencing?
@hackiftekhar are we doing it correctly to disable library?
IQKeyboardManager.sharedManager().enable = false
Yes, you are doing correct. But this only disable managing distance between textField and keyboard. If you want to disable toolbar then there is another property to do that.
It turns out that the issue was something else entirely. Calling tableView's reloadData
automatically resigns first responder, and that's what's interfering with the implementation. Sorry for the trouble!
@meet2011 hope this points you to the right direction
How to disable/enable toolbar for particular controller.
I want to disable so that I can use my code for tool bar as your code is not working perfectly for me.
@meet2011 enableAutoToolbar = NO
Tried the following:
in my StakesViewController:
in my AppDelegate:
Either implementation doesn't work. I even tried implementing both to no avail.