How to dismiss an UIAlertController and the keyboard simultaneously?

后端 未结 8 1257
离开以前
离开以前 2021-02-05 13:04

I have created a signup form with a UIAlertController and used the method addTextFieldWithConfigurationHandler to add a text field. But there is a litt

8条回答
  •  你的背包
    2021-02-05 13:27

       - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
    
       { 
           [self.view endEditing:YES];
          // or you can write [yourtextfield refignFirstResponder]
           [alertView dismissWithClickedButtonIndex:buttonIndex animated:TRUE];
       }
    

提交回复
热议问题