UIKeyboardTypeDefault, // 默认键盘:支持所有字符
UIKeyboardTypeASCIICapable, // 支持ASCII的默认键盘
UIKeyboardTypeNumbersAndPunctuation, // 标准电话键盘,支持+*#等符号
UIKeyboardTypeURL, // URL键盘,有.com按钮;只支持URL字符
UIKeyboardTypeNumberPad, //数字键盘
UIKeyboardTypePhonePad, // 电话键盘
UIKeyboardTypeNamePhonePad, // 电话键盘,也支持输入人名字
UIKeyboardTypeEmailAddress, // 用于输入电子邮件地址的键盘
可以设置textfield.KeyBoardType= UIKeyboardTypeDefault;
#pragma mark=================== //textView工具框
-(void)configAccessoryView:(UITextField *)sender
{
UIToolbar * topView = [[UIToolbar alloc]initWithFrame:CGRectMake(0, 0, 320, 40)];
[topView setBarStyle:UIBarStyleBlack];
UIBarButtonItem * btnSpace = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil];
UIBarButtonItem * cancelButton = [[UIBarButtonItem alloc]initWithTitle:@"キャンセル" style:UIBarButtonItemStyleBordered target:self action:@selector(dismissKeyBoard)];
UIBarButtonItem * doneButton = [[UIBarButtonItem alloc]initWithTitle:@"決定" style:UIBarButtonItemStyleBordered target:self action:@selector(dismissKeyBoard)];
NSArray * buttonsArray = [NSArray arrayWithObjects:cancelButton,btnSpace,btnSpace,doneButton,nil];
[topView setItems:buttonsArray];
[sender setInputAccessoryView:topView];
}