天天看点

keyboard ios 虚拟键盘 删除键的响应

uitextview 的处理
           
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
           
{
    if([text length] != 0) //点击了非删除键
    {
    }
    else
    {
        text ; // 按键对应的str
    }
}
           

UITextField 的处理

- (BOOL)textFieldShouldClear:(UITextField *)textField;               // called when clear button pressed. return NO to ignore (no notifications)
- (BOOL)textFieldShouldReturn:(UITextField *)textField;              // called when 'return' key pressed. return NO to ignore.