IOS隐藏键盘

阅读更多

 

//UITextField的Did End On Exit 调用下面事件
- (void)KeyExit:(id)sender
{
    NSLog(@"关闭键盘提交!");
    [sender resignFirstResponder];
}

 

 

 

//点击屏幕调用下面事件
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
    NSLog(@"隐藏键盘!");
    UITouch *touch=[[event allTouches] anyObject];
    if (touch.tapCount >=1) {
        [EVresumePassword resignFirstResponder];
        [EVnewPassword resignFirstResponder];
        [EVoldPassword resignFirstResponder];
    }
}

你可能感兴趣的:(IOS,隐藏,键盘)