码迷,mamicode.com
首页 > 其他好文 > 详细

点击 View 空白释放键盘

时间:2015-03-05 18:40:07      阅读:107      评论:0      收藏:0      [点我收藏+]

标签:

 在view上添加一个UITapGestureRecognizer
- (void)viewDidLoad
{
[super viewDidLoad];
UITapGestureRecognizer *tapGr = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(viewTapped:)];
tapGr.cancelsTouchesInView = NO;
[self.view addGestureRecognizer:tapGr];
}
-(void)viewTapped:(UITapGestureRecognizer*)tapGr{
[activitySearchBar resignFirstResponder];
}

点击 View 空白释放键盘

标签:

原文地址:http://www.cnblogs.com/allanliu/p/4316196.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!