当我更改inputAccessoryView
iOS 8中的高度时,inputAccessoryView不会转到右侧原点,而是覆盖键盘.
以下是一些代码段:
- (UIView *)inputAccessoryView {
if (!_commentInputView) {
_commentInputView = [[CommentInputView alloc] initWithFrame:CGRectMake(0, 0, [self width], 41)];
[_commentInputView setPlaceholder:NSLocalizedString(@"Comment", nil) andButtonTitle:NSLocalizedString(@"Send", nil)];
[_commentInputView setBackgroundColor:[UIColor whiteColor]];
_commentInputView.hidden = YES;
_commentInputView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleBottomMargin;
}
return _commentInputView;
}
Run Code Online (Sandbox Code Playgroud)
#when the textview change height
- (void)growingTextView:(HPGrowingTextView *)growingTextView willChangeHeight:(float)height {
if (height > _textView_height) {
[self setHeight:(CGRectGetHeight(self.frame) + height - _textView_height)];
[self reloadInputViews];
}
}
Run Code Online (Sandbox Code Playgroud)
- (void)setHeight: (CGFloat)heigth {
CGRect frame = self.frame;
frame.size.height …
Run Code Online (Sandbox Code Playgroud)