您的位置:首页 > 其它

点击空白关闭键盘

2016-12-06 17:26 246 查看
//点击空白收回键盘

-(void)touchReturnPad{

    self.view.userInteractionEnabled = YES;

    UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fingerTapped:)];

    [self.view addGestureRecognizer:singleTap];

}

-(void)fingerTapped:(UITapGestureRecognizer *)gestureRecognizer

{

    [self.view endEditing:YES
4000
];

    

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: