I have some iPad app where user will navigate using touch screen OR bluetooth keyboard. I have some hidden textView which is in focus (first responder) and here I detect what is entered from keyboard.
But, when I disconnect keyboard, I have a problem, virtual keyboard appears.
Can I check if bluetooth keyboard is connected or not, and to set or resign first responder in viewDidLoad or something?
or
I have notification:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillAppear:) name:UIKeyboardWillShowNotification object:nil];
Can I hide keyboard on some way when keyboardWillAppear is triggered? I tried [textView resignFirstResponder], but without success :|
You could set the inputView to a transparent view:
UIView *emptyView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
emptyView.backgroundColor = [UIColor clearColor];
textView.inputView = emptyView;
In theory that would set the onscreen keyboard to an empty view so it wouldn't be visible. If it doesn't accept a view with no frame then try bumping the width and height to 1. It wouldn't affect the external keyboard; it just wouldn't show up on the device.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With