点击tableView空白处隐藏键盘

1.点击tableView空白处隐藏键盘

  UITapGestureRecognizer *tableViewGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tableViewTouchInSide)];

    tableViewGesture.numberOfTapsRequired = 1;//几个手指点击

    tableViewGesture.cancelsTouchesInView = NO;//是否取消点击处的其他action

    [self.tableView addGestureRecognizer:tableViewGesture];

    

- (void)tableViewTouchInSide{

   

    [self.view endEditing:YES];

}

猜你喜欢

转载自blog.csdn.net/ochenmengo/article/details/84033397
今日推荐