Custom UIKeyboard - iphone

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.

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.

Related

how to customize key board in ios [duplicate]

I want to create a khmer keyboard which is different from iPhone keyboard. How can I do that ?
Unfortunately, you cannot control the language of the keyboard. The user chooses which keyboards they would like available via the settings application and can toggle between them using the globe icon on the keyboard. When the keyboard is opened it will open to the most recently used keyboard.
make a customize keyboard. take a UIView add UIButton and add what you want to all in this view.
Starting from iOS 4, UITextField and UITextView have a property called inputView. It should be a view able to receive the taps and send to the UIViewController that holds your text field. So, can create a UIViewController with delegate methods, and set it's view as the inputView of your UITextField or UITextView. So, assuming that MyCustomKeyboard is the UIViewController that is your keyboard, including the view and the delegate methods, in your viewDidLoad of your view controller, you should put:
MyCustomKeyboard *customKeyboard = [[MyCustomKeyboard alloc] init];
customKeyboard.delegate = self;
myTextField.inputView = customKeyboard.view;
And in your view controller you handle the delegate methods of your MyCustomKeyboard class.
If you want a tutorial, there is a good one in Ray Wenderlich website, you should do something similar to the iPhone.
I don't think it can be done just for one app, two options:
The user has to change to the correct language.
Since that is not what you want, there is option 2:
Implement your own keyboard (=huge amount of work)

how to make a keyboard in other language in iOS

I want to create a khmer keyboard which is different from iPhone keyboard. How can I do that ?
Unfortunately, you cannot control the language of the keyboard. The user chooses which keyboards they would like available via the settings application and can toggle between them using the globe icon on the keyboard. When the keyboard is opened it will open to the most recently used keyboard.
make a customize keyboard. take a UIView add UIButton and add what you want to all in this view.
Starting from iOS 4, UITextField and UITextView have a property called inputView. It should be a view able to receive the taps and send to the UIViewController that holds your text field. So, can create a UIViewController with delegate methods, and set it's view as the inputView of your UITextField or UITextView. So, assuming that MyCustomKeyboard is the UIViewController that is your keyboard, including the view and the delegate methods, in your viewDidLoad of your view controller, you should put:
MyCustomKeyboard *customKeyboard = [[MyCustomKeyboard alloc] init];
customKeyboard.delegate = self;
myTextField.inputView = customKeyboard.view;
And in your view controller you handle the delegate methods of your MyCustomKeyboard class.
If you want a tutorial, there is a good one in Ray Wenderlich website, you should do something similar to the iPhone.
I don't think it can be done just for one app, two options:
The user has to change to the correct language.
Since that is not what you want, there is option 2:
Implement your own keyboard (=huge amount of work)

How to define a custom keyPad in my App?

I want define a custom keyboard in my App,When I press one TabBar Item in my UITabBarController, then custom keyboard slide up, when I touch the the tabview, I hope the custom keyboard can slide down, But, Because the custom keyboard add in UITabBarController's view, and tableView add in UIViewController one of UITabBarController's ViewController, they are not in the same Class, How can I define the Keyboard, and add to which view?
I want to do like this:
When Press tab bar Item keyboard slide up,
http://i.stack.imgur.com/66NDu.png
When touch tableview, keyboard slide down.
http://i.stack.imgur.com/ZiHaR.png
Make a custom UIView with your custom keyboard buttons.
UITextField and UITextView have a property called inputView. If you set your custom view to this, iOS automatically takes care of resignFirstResponder and becomesFirstResponder messages on the text field.
This is the easiest way to use a custom keyboard.
Why are you declaring the custom keyboard in the UITabBarController class ? You can declare it in the view controller that is attached to that particular tabBarItem. If you add it to the that view controller, I am sure you can just make it resignFirstResponder or removeFromSuperView and manipulate it as you want.
Or you can just create a separate class for your customKeyboard, and add it along with your other classes. Simply include that class and create objects in other view controllers to manipulate them, and then release them. This is very easy and it is better programming compared to your approach, as at a later point of time, if you need to make changes or release 2.0 version of your app, it will come in handy and save some development time !

iPhone: how can I activate a text field programmatically (and not wait for the user to touch it)

I have a UIViewController that is a UITextFieldDelegate, and I would like the keyboard for its text field to appear as soon as the user navigates to this view, without having to actually touch the text field. It would also be nice to be able to "dismiss" the entire view when the keyboard is dismissed. I am loading the view from a xib file.
I don't have an ivar in the code for the UITextField as yet. I would guess I need one. At this point I am just relying on the delegate to pop up the keyboard.
(I know its not a UITextViewDelegate, like the tag says, but I am new to stackoverflow and can't create the correct UITextFieldDelegate tag.)
Sounds like you want to use [textField becomeFirstResponder] in viewDidAppear.

UITextFieldDelegate != IBAction backgroundTap

The scope of this question is IPhone 3.1 sdk (app running in simulator still)
I have a table view that has a cell with a UITextField in that cell. The table view is grouped, and has one section with just a couple fields. Im NOT using IB so backgroundTap is out of the question (as far as i can tell at least). When i click the text field, keyboard shows. Hiding it is still troublesome. Ive pulled the UITextFieldDelegate into the mix to hide the keyboard but the textFieldShouldEndEditing method doesnt seem to fire when the background is tapped (when i mean background, im tapping outside of the grouped table view section). First off, should it?
textFieldShouldReturn fires with no problem and i can resign at this point but shouldnt i be able to resign if focus shifts away from that control?
Any help is much appreciated
-me
Generally you'll only stop editing a field when you:
hit the "Done" or action button on the keyboard
begin editing another field
exit the view
have another button on screen that removes focus
From any of these, you can call -[textField resignFirstResponder] to dismiss the keyboard and call your -textFieldShouldEndEditing: method. There's no reason that just tapping on a non-active part of the screen should dismiss the keyboard.