KRKeyboard: A multi-function keyboard.
- numeric
- alphabetic
- symbol
- password
- Drag
KRKeyboard
folder into your project.- Import
KRKeyboard.h
- init KRKeyboard
- implementation protocol
- run project :)
// 数字键盘
KRKeyboard * zxKB = [KRKeyboard creatWithKeyboardType:NumberKeyboard delegateTarget:self];
// 设置为输入键盘, tf 是 UITextField 对象
tf.inputView = zxKB;
// 字母键盘
KRKeyboard * zxKB = [KRKeyboard creatWithKeyboardType:LetterKeyboard delegateTarget:self];
// 设置为输入键盘, tf 是 UITextField 对象
tf.inputView = zxKB;
// 符号键盘
KRKeyboard * zxKB = [KRKeyboard creatWithKeyboardType:SymbolKeyboard delegateTarget:self];
// 设置为输入键盘, tf 是 UITextField 对象
tf.inputView = zxKB;
// 密码键盘
KRKeyboard * zxKB = [KRKeyboard creatWithKeyboardType:PassWordKeyboard delegateTarget:self];
// 设置为输入键盘, tf 是 UITextField 对象
tf.inputView = zxKB;
/**
按键回调
@param key 单击的文本
@param keyType 单击的文本类型
@param keyboardType 键盘类型
@param content 已输入的内容
*/
- (void)pressKey:(NSString *)key keyType:(KRKeyType)keyType keyboardType:(KRKeyboardType)keyboardType content:(NSString *)content;
on Define.h
file
//------ 键盘配置 ------//
// 字体及大小
#define KRFONTNAME @"Helvetica-light"
// 键盘高度
#define KRKEYBOARDHEIGHT KSCREEN_HEIGHT * 0.4
// 键盘顶部logo视图的高度
#define KRLOGOVIEW_HEIGHT 40
[zxKB setClickSoundEnable:NO]; // 是否开启键盘声音
Q Q: 448150220
Wechat: dengsir058
E-mail: dengsir@goldenbeetech.com