首页 > 代码库 > iOS 键盘的关闭

iOS 键盘的关闭

iOS 键盘的关闭

//通过委托来放弃 “第一响应者”#pragma mark - UITextField Delegate Method-(BOOL)textFieldShouldReturn:(UITextField*)textField{    [textField resignFirstResponder];    return YES;}//通过委托来放弃 “第一响应者”#pragma mark - UITextView Delegate Method-(BOOL)textview:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{    if([text isEqualToString:@"\n"]){        [textView resignFirstResponder];        return NO;    }    return YES;    }

 

iOS 键盘的关闭