iOS系统键盘和自定义键盘的切换
2016-03-27 11:33
651 查看
// 1. 给UITextView添加一个可点击的UIControl UIControl *control = [[UIControl alloc] initWithFrame:_inputView.bounds]; [control addTarget:self action:@selector(inputViewTapHandle) forControlEvents:UIControlEventTouchUpInside]; [_inputView addSubview:control];
#pragma mark - 从别的inputView切换为系统键盘
- (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];
}
相关文章推荐
- CocoaPods的使用
- iOS开发小技巧--textField成为密码框,view加载完后textField获取焦点
- iOS中的关联对象
- iOS开发小技巧--tableView中实现无数据无分割线,有数据才有分割线
- ios-基础之【11】-类的category
- ios-基础之【10】-NSTimer
- iOS 断言 NSAssert的使用 调试程序错误
- ios-其他之【1】-证书
- 玩转iOS开发 - 数据缓存
- iOS开发 ☞ 常用终端命令
- iOS中几种数据持久化方案-转自简书
- iOS 使用NSMutableAttributedString实现不同颜色尺寸文字 —— HERO博客
- OC阅读笔记三:动态绑定
- iOS BeizierPath 绘图
- iOS-消息转发机制
- IOS基础-事件机制
- IOS 杂笔-16 (-(void)scrollViewDidEndScrollingAnimation:方法使用注意)
- IOS 禁止横屏、键盘的隐藏、键盘出现时上移后面的视图
- 我的iOS开发入门自学路径
- ios 从url字符串中获取图片名字