iphone:点击背景隐藏键盘
2012-05-04 21:10
239 查看
修改视图控制器的view属性,将它的底层类由UIView更改为UIControl
添加一个Action,Action是Touch Down
- (IBAction)backgroudTap:(id)sender {
[myTextField resignFirstResponder];
}
记住你的UITextField的Outlet一定要是weak的属性(一般的Outlet都是weak的),不然会出错
-[UITextInputTraits resignFirstResponder]: unrecognized selector sent to instance
添加一个Action,Action是Touch Down
- (IBAction)backgroudTap:(id)sender {
[myTextField resignFirstResponder];
}
记住你的UITextField的Outlet一定要是weak的属性(一般的Outlet都是weak的),不然会出错
-[UITextInputTraits resignFirstResponder]: unrecognized selector sent to instance
相关文章推荐
- iOS开发textField点击背景空白隐藏收起键盘的N种方法
- ios菜鸟之路:textfield隐藏键盘以及点击背景取消键盘
- iOS开发textField点击背景空白隐藏收起键盘的N种方法
- iphone点击空白隐藏键盘
- 点击背景关闭 iPhone 键盘的代码例子
- iOS开发中,点击界面空白处或点击背景收起键盘
- Js控制iphone端的input/textarea元素失去焦点时隐藏键盘
- Iphone开发(四)文本框,文本视图,和软键盘的隐藏
- IOS7 点击空白处隐藏键盘的几种方法
- 点击tableView时触发事件,比如隐藏键盘
- iOS 上常用的两个功能:点击屏幕和return退出隐藏键盘和解决虚拟键盘挡住UITextField的方法
- iOS点击空白区域隐藏键盘
- iOS点击空白处隐藏键盘的几种方法
- [置顶] Objective-C ,ios,iphone开发基础:在UITextField输入完以后,隐藏键盘,
- Android点击屏幕空白处,隐藏键盘
- 2016-01-07 点击任何地方的 键盘隐藏
- [iOS] UITextField隐藏软键盘心得(隐藏自身软键盘、点击Return自动转到下个文本框、轻触背景隐藏软键盘)(转)
- ,随便点击屏幕任何位子都可以resignFirstResponder,隐藏键盘的两种方法
- 任意处点击实现软键盘隐藏
- Android 手动显示和隐藏软键盘 点击空白处隐藏键盘