26
2011
CLKeypad, A Customized iPhone Keyboard NumberPad
CLKeypad is a customized iPhone keyboard NumberPad with a customized toolbar. It has the same function as UIKeyboardTypeNumberPad except that CLKeypad provide an extra decimal point button. You can customize the toolbar and each of the keys with your own image.
To use CLKeypad, you just need to implement it’s delegates,
- (void)hideCLKeypad; - (void)numberPressed:(NSString *)number;
and the UITextFieldDelegate to assign the texfield’s inputView(toolbar) and inputAccessoryView(keypad):
-(void)textFieldDidBeginEditing:(UITextField *)textField{ if (keypad == nil) { keypad = [[CLKeypad alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, KEYBOARD_HEIGHT)]; keypad.delegate = self; } if (textField.inputAccessoryView == nil) [textField setInputAccessoryView:keypad.toolbar]; if (textField.inputView == nil) textField.inputView = keypad; }
The first delegate, ‘hideCLKeypad’ method is for dismissing the keypad when user hit the ‘done’ button on the toolbar. The second delegate, ‘numberPressed’ method will pass the number pressed to your controller.
A sample code is included in my github, you are free to download, edit and use it for your own project.
For tutorial on how to implement this custom keypad, stay tuned for my next post.
Leave a comment
Ads
Facebook Page
Categories
- Apache (1)
- Apps (2)
- Blog (19)
- IOS (20)
- IOS Library (5)
- iPhone Tutorial (17)
- Javascript (1)
- Node.js (1)
- Twitter (1)

An article by





