// 1. 給UITextView增加一個可面擊的UIControl? ? UIControl *control = [[UIControl alloc] initWithFrame:_inputView.bounds];? ? [control addTarget:self]瓶您;
// 1. 給UITextView添加一個可點擊的UIControl
UIControl *control = [[UIControl alloc] initWithFrame:_inputView.bounds];
[control addTarget:self action:@selector(inputViewTapHandle) forControlEvents:UIControlEventTouchUpInside];
[_inputView addSubview:control];
#pragma mark - 從別的inputView切換為系統(tǒng)鍵盤
//強行調(diào)用系統(tǒng)鍵盤
- (void)inputViewTapHandle{
? ? MyLog(@"%s", __FUNCTION__);
? ? [_inputView becomeFirstResponder];
? ? _inputView.inputView = nil;
? ? [_inputView reloadInputViews];
}
- (void)addBtnClick
{
[_inputView resignFirstResponder];
MyLog(@"%s", __FUNCTION__);
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 150)];
view.backgroundColor = [UIColor grayColor];
_inputView.inputView = view;
[_inputView becomeFirstResponder];
}
- (void)smileBtnClick
{
[_inputView resignFirstResponder];
MyLog(@"%s", __FUNCTION__);
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 150)];
view.backgroundColor = [UIColor orangeColor];
_inputView.inputView = view;
[_inputView becomeFirstResponder];
}