点击tableview的时候隐藏键盘
2016-07-13 本文已影响38人
Minoz_min
点击tableview的时候隐藏键盘
- (void)viewDidLoad {
[super viewDidLoad];
UITapGestureRecognizer *tapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideKeyboard)];
tapGes.cancelsTouchesInView = false;
[self.tableView addGestureRecognizer:tapGes];
}
- (void)hideKeyboard
{
[self.textfieldUsername resignFirstResponder];
}