ios菜鸟之路:textfield隐藏键盘以及点击背景取消键盘
来源:互联网 发布:php exec 返回值 编辑:程序博客网 时间:2024/05/01 05:03
一、点击Done按键隐藏键盘:
//在头文件.h中 初始化
@property (strong, nonatomic) IBOutlet UITextField *account_reg_TextField;
@property (strong, nonatomic) IBOutlet UITextField *passwd_reg_TextField;
@property (strong, nonatomic) IBOutlet UITextField *check_passwd_reg_TextField;
//action 事件选择 did end on exit
- (IBAction)paswdDoneEditng:(id)sender;
- (IBAction)checkpasswdDoneEditing:(id)sender;
//在.m文件中实现方法
- (IBAction)textfieldDoneEditing:(id)sender {
[account_reg_TextField resignFirstResponder];
}
- (IBAction)paswdDoneEditng:(id)sender {
[passwd_reg_TextField resignFirstResponder];
}
- (IBAction)checkpasswdDoneEditing:(id)sender {
[check_passwd_reg_TextField resignFirstResponder];
}
二、帅帅的背景点击取消键盘
选择视图,在最右边的custom class中选择UIButton 即把背景改成了button事件
- (IBAction)backgroundbutton:(id)sender;
//.m文件的实现
- (IBAction)backgroundbutton:(id)sender {
[account_reg_TextField resignFirstResponder];
[passwd_reg_TextField resignFirstResponder];
[check_passwd_reg_TextField resignFirstResponder];
}
可以了吧 嘻嘻
- ios菜鸟之路:textfield隐藏键盘以及点击背景取消键盘
- IOS中TextField点击取消键盘
- iOS开发textField点击背景空白隐藏收起键盘的N种方法
- iOS开发textField点击背景空白隐藏收起键盘的N种方法
- 点击背景页面取消键盘
- iOS——点击背景取消键盘的方法
- iOS 之点击背景退出键盘
- iOS 之点击背景退出键盘
- iOS 之点击背景退出键盘
- textfield 点击屏幕任何地方隐藏键盘
- 猫猫学iOS之iOS键盘隐藏,下一个textField,键盘控制第三方好用框架IQKeyboardManager
- iOS模拟器,点击textfield弹出键盘
- IOS点击return隐藏键盘
- TextField隐藏键盘
- iOS TextField输入框点击键盘时随着键盘上移
- 取消隐藏ios键盘的方法
- ios学习之 点击屏幕任何地方隐藏键盘实现
- iOS之iOS键盘隐藏
- Spring学习笔记 关于spring 2.x中dependency-check标签与Spring3中的实现方式
- hbase表结构设计研究(不断更新)
- eclipse报出的错误
- hbase修复.META.表与HDFS文件不一致问题
- CX51 用户手册----MODP2 伪指令
- ios菜鸟之路:textfield隐藏键盘以及点击背景取消键盘
- android View.measure
- 自己写bootloader2 -init.c,基于s3c2440
- 自己动手学TCP/IP--以太网帧
- hbase中region的规划与硬盘配置分析
- 笔记-- vs2008 ,右键转到定义,弹出“未定义符号”
- android屏幕亮度的调整
- 拦截器中多个URL-PATTERN配置
- 切片源图片的工具MapCruncher使用说明