|
@@ -30,11 +30,27 @@
|
|
|
self.inputTextView.autocapitalizationType = UITextAutocapitalizationTypeNone;
|
|
self.inputTextView.autocapitalizationType = UITextAutocapitalizationTypeNone;
|
|
|
self.inputTextView.autocorrectionType = UITextAutocorrectionTypeNo;
|
|
self.inputTextView.autocorrectionType = UITextAutocorrectionTypeNo;
|
|
|
self.inputTextView.delegate = self;
|
|
self.inputTextView.delegate = self;
|
|
|
|
|
+ self.inputTextView.inputAccessoryView = ({
|
|
|
|
|
+ UIToolbar *toolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 50)];
|
|
|
|
|
+ UIBarButtonItem *spaceItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
|
|
|
|
|
+ UIBarButtonItem *doneItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(textViewDone)];
|
|
|
|
|
+ toolBar.items = @[spaceItem, doneItem];
|
|
|
|
|
+ toolBar;
|
|
|
|
|
+ });
|
|
|
[self addSubview:self.inputTextView];
|
|
[self addSubview:self.inputTextView];
|
|
|
}
|
|
}
|
|
|
return self;
|
|
return self;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+#pragma mark - private
|
|
|
|
|
+
|
|
|
|
|
+- (void)textViewDone
|
|
|
|
|
+{
|
|
|
|
|
+
|
|
|
|
|
+ [self.inputTextView resignFirstResponder];
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
|
|
|
#pragma mark - Text View Changes
|
|
#pragma mark - Text View Changes
|
|
|
|
|
|