I have an UITextView and I don't want check editable option, how can call keyboard via a button? This code doesn't work for me!
-(IBAction) yourButtonClick
{
[myTextView becomeFirstResponder];
[self.view addSubview:myTextView];
}
Go to Settings > Accessibility > Keyboards, tap Full Keyboard Access, then turn on Full Keyboard Access.
Simply, restart your device and you might be surprised to see the keyboard back and working on your iPhone or iPad. Go to Settings > General > scroll down and tap on Shut Down. On the next screen, use the Slider to Shut Down iPhone. Wait for 30 seconds and Restart iPhone.
Open any app that uses the keyboard, such as the Notes app. Tap and hold the keyboard icon in the bottom right corner of the keyboard. A menu will appear. Keep holding your finger on the screen and drag your finger to select the Floating keyboard option.
As is often the case with computers, it's possible that some sort of temporary software glitch is keeping the keyboard from appearing on screen. Restarting your iPad — turning it off and then back on again — can resolve most of these kinds of problems. Restart it and check the onscreen keyboard again.
From the iPhone Application Programming Guide
However, you can programmatically display the keyboard for an editable text view by calling that view’s becomeFirstResponder method. Calling this method makes the target view the first responder and begins the editing process just as if the user had tapped on the view.
So to show the keyboard programmatically,
[textView becomeFirstResponder];
However, the keyboard will never show if the textView is not editable.
The purpose of showing the keyboard is to allow editing. I assume you just don't want the keyboard to appear when the user taps the text view. In this case, you can enable editable programmatically when the button is tapped.
-(IBAction) yourButtonClick
{
myText.editable = YES;
[myText becomeFirstResponder];
}
Then in the UITextViewDelegate, disable editable when the user finishes editing.
- (void)textViewDidEndEditing:(UITextView *)textView {
textView.editable = NO;
}
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