zoukankan      html  css  js  c++  java
  • 键盘收回方法

     1 -(BOOL)textFieldShouldReturn:(UITextField *)textField
     2 {
     3     [textField resignFirstResponder];
     4     return NO;
     5 }
     6 
     7 - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
     8 {
     9     [self.gMonthTextField resignFirstResponder];
    10 }
    11 
    12 - (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
    13 {
    14     [self.gMonthTextField resignFirstResponder];
    15     [[[UIApplication sharedApplication] keyWindow] endEditing:YES];
    16     [self.view endEditing:YES];
    17     [[UIApplication sharedApplication] sendAction:@selector(resignFirstResponder) to:nil from:nil forEvent:nil];
    18 }
  • 相关阅读:
    第十四次会议
    第十三次会议
    第十二次会议
    第十一次会议
    第十次会议
    第九次会议
    第八次会议
    第七次会议
    第六次会议
    机器学习
  • 原文地址:https://www.cnblogs.com/fengmin/p/5591364.html
Copyright © 2011-2022 走看看