开发者

How to prevent UITableView interaction while UITextField is FirstResponder

开发者 https://www.devze.com 2023-02-24 11:23 出处:网络
Is there a simple way to开发者_StackOverflow社区 prevent user interaction while entering text in a UITextField (the textfield is in a cell of the tableView)?

Is there a simple way to开发者_StackOverflow社区 prevent user interaction while entering text in a UITextField (the textfield is in a cell of the tableView)?

I've already tried this:

- (void)textFieldDidBeginEditing:(UITextField *)textField {
    self.tableView.userInteractionEnabled = NO;
}

with the result that the keyboard also stops showing up...


The first thought that comes to mind is adding a transparent UIView overlay that would "mask" everything surrounding your cell, intercepting all the touch events. I suppose it would have to be two overlays - one for above the cell and one for below.

0

精彩评论

暂无评论...
验证码 换一张
取 消