How to make application keyboard same as safari keyboard in iPhone?

iphone, keypad, safari

Solution

That's quite easy, all you need is a UIToolBar on top of your keyboard!

UIToolBar Apple Doc

And, how to do it:

UIToolbar *myToolBar = [[UIToolbar alloc] init];
myToolBar.barStyle = UIBarStyleDefault;
[myToolBar sizeToFit];


UIBarButtonItem *leftBarButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(buttonClicked:)];
NSArray *array = [NSArray arrayWithObject:leftBarButton];
[leftBarButton release];
[myToolBar setItems:array];

myTextField.inputAccessoryView = myToolBar;
[myToolBar release];

Problem

My client asked me to make numeric keypad looks as it is visible in safari. In safari the keypad is visible with three more buttons at the top that are prev next and done. I want to achieve the same. Please tell me the way to achieve this. Thanks in advance

Original source