iOS 回收键盘

先要遵循协议  设置代理

 

    self.jiagetextfield.delegate=self;
    self.mingchengtextfield.delegate=self;

 

//释放第一响应者
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
    [self.mingchengtextfield resignFirstResponder];
    [self.jiagetextfield resignFirstResponder];
 
}



//bool 释放第一响应者
-(BOOL)textFieldShouldReturn:(UITextField *)textField{
    [textField resignFirstResponder];
    return YES;
}

posted on 2015-07-24 10:08  yucaijiang  阅读(195)  评论(0编辑  收藏  举报

导航