Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display the iPhone keyboard

I've run into a problem with the UITextView that seems to be related to having a scrollable view within a scrollable view.

In order to remedy this i thought i would attempt to write my own multiline (but not scrollable) text view. Given the core graphics methods, and the UITextInputTraits class it seems like this should be feasable. The only thing i cant figure out is wether or not its possible to display (and catch events) for the system wide keyboard.

Is this even possible using the SDK?

like image 454
Lounges Avatar asked Jan 22 '09 00:01

Lounges


People also ask

How do I bring up the OnScreen keyboard?

To open the On-Screen KeyboardGo to Start , then select Settings > Ease of Access > Keyboard, and turn on the toggle under Use the On-Screen Keyboard. A keyboard that can be used to move around the screen and enter text will appear on the screen. The keyboard will remain on the screen until you close it.

Why is my iPhone keyboard not showing up?

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.

How do you unhide keyboard on iPhone?

Tap on a Text Input AreaDouble tapping or triple tapping into a text area on the screen can often make the keyboard appear if it's otherwise hidden off the screen.


1 Answers

What I did in a similar situation, is made a hidden UITextField, and set its delegate to your class where you can implement the appropriate UITextFieldDelegate methods to intercept the key's pressed.

something like this:

UITextField *myHiddenTextField = [[UITextField alloc] initWithFrame: cgRectZero()];
myHiddenTextField.delegate = self;
[myHiddenTextField becomeFirstResponder];

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
//use string here for the text input
return false;
}
like image 123
Brad The App Guy Avatar answered Oct 02 '22 04:10

Brad The App Guy