UITextView有inputView 和 inputAccessoryView 两个属性,都指定了相应的视图, inputAccessoryView 对象显示在 inputView 对象的上面。与输入相关的还有一个 reloadInputViews 方法用来重新载入输入视图。如图:
代码:
if (bt.selected == YES) { bt.selected = NO; [m_textView setInputView:nil]; [m_textView becomeFirstResponder]; }else if(bt.selected == NO){ addEmojiImgView = [AddEmojiImgView initEmojiImgView]; [m_textView setInputView:addEmojiImgView]; bt.selected = YES; [m_textView becomeFirstResponder]; } [m_textView reloadInputViews];
UITextView自定义键盘和系统键盘
时间: 2024-10-04 22:00:48