textView 小记

改换行为完成

textView.keyboardType = UIKeyboardAppearanceDefault;
textView.returnKeyType = UIReturnKeyDone;

点击完成不输入\n

textView.delegate = self;
- (BOOL)textView:(YYTextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
    if ([text isEqualToString:@"\n"]){
        [self.view endEditing:YES];
        return NO;
    }
    return YES;
}

你可能感兴趣的:(textView 小记)