实现这个函数:
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
NSString *newString = [textFiled.text stringByReplacingCharactersInRange:range withString:string];
short strLen = [newString length];
unichar tempChar = [newString characterAtIndex:strLen-1];
// 这里判断tempChar是不是你要禁用的键,若要禁用就return NO
}
iphone弹出键盘部分按键禁用
最新推荐文章于 2025-09-07 00:17:51 发布
