ios键盘切换自定义键盘

#pragma mark -- 点击 表情 按钮
- (void)selectImageText:(UIButton *)butt{
    
    butt.selected = !butt.selected;
    
    //    右边视图  选择 为  自定义表情   未选中  为  系统
    int type = (butt.selected ? 1 : 0);
    
    if (type == 1) {
        
        if (emoView == nil) {
            
            //            4  行    7 列
            emoView = [[EmoView alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height - kEmoViewH, MScreenW, kEmoViewH) row:4 col:7];
    
            emoView.delegate = self;
        }
        
        emoView.hidden = NO;
        
        _textHideView.inputView = emoView;
        // 必须实现  不然不能切换键盘
        [_textHideView reloadInputViews];
        
    } else{
        
        //        self.textView.inputView = emoView;
        _textHideView.inputView = nil;
        
        [_textHideView reloadInputViews];
    }
    
    [_textHideView becomeFirstResponder];
}

你可能感兴趣的:(ios键盘切换自定义键盘)