1

Will really appreciate this if you can help me.Want to create a custom Keyboard that is compatible from iOS 3.0 and onwards.When click on the UITextField want to show my own keyboard.UItextfield inputView is being called on iOS > 3.0.

Khalil Ghaus
  • 251
  • 1
  • 3
  • 15
  • can i know y u want to create u r own key board – Rama Rao Mar 01 '12 at 05:30
  • Have a look to this SO post .. http://stackoverflow.com/questions/2275685/creating-a-custom-uikeyboard-for-iphone – Jhaliya - Praveen Sharma Mar 01 '12 at 05:32
  • Put a custom invisible button on textField when user taps on the button then show your Custom Keyboard view and also put textField.editing=NO ; – dark Mar 01 '12 at 05:33
  • Take a Look at This SO Question Hop it will help you [Question Link][1] [1]: http://stackoverflow.com/questions/2573797/iphone-possible-to-not-show-keyboard-but-still-show-the-cursor-in-a-uitextfiel – aadil Hafeez Mar 01 '12 at 06:42
  • Take a Look at This SO Question Hop it will help you [http://stackoverflow.com/questions/2573797/iphone-possible-to-not-show-keyboard-but-still-show-the-cursor-in-a-uitextfiel][1] [1]: http://stackoverflow.com/questions/2573797/iphone-possible-to-not-show-keyboard-but-still-show-the-cursor-in-a-uitextfiel – aadil Hafeez Mar 01 '12 at 06:44

1 Answers1

0

I have made a custom keyboard in my app. I created it in interface builder and made some class files for it. In the class files I created a protocol to call some delegate methods when the user presses on different buttons of the keyboard. In your view that you want to have your keyboard, just add a UITextField that is of location and size (0,0,0,0). The textfield will only serve as a mechanism to bring up your keyboard. Then in viewDidLoad or at an appropriate time you can set your UITextFields input view like this:

self.myTextField.inputView = self.myKeyboard.view;

Don't forget to set yourself as the delegate of your own keyboard.

self.myKeyboard.delegate = self;

Then when the user does something which warrants bringing up the keyboard, just call becomeFirstResponder on your keyboard. The key is to do it on the textField. Since your keyboard is the input view, it will come up instead.

[self.myTextField becomeFirstResponder];

When you want to dismiss it just resign it.

[self.myTextField resignFirstResponder];

and any buttons that your user clicks on on your keyboard should be handled by delegation.

Good luck to you.

Jamie
  • 5,090
  • 28
  • 26