Dismiss keyboard on touch anywhere outside UITextField

前端 未结 8 1837
梦毁少年i
梦毁少年i 2020-11-27 17:22

I am developing an iPad app that has a large number of UIViewControllers, UITableViews (with cells with accessoryViews of UIText

8条回答
  •  一整个雨季
    2020-11-27 17:37

    Add a "textFieldDidChange" notification method to the text field control.

    [textField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingDidEnd];

    works for me

提交回复
热议问题