标签:io ar os sp for on cti bs ad
- (void)viewDidLoad
{
[super viewDidLoad];
UITapGestureRecognizer *gesture=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(CloseKeyBoard:)];
[self.view addGestureRecognizer:gesture];
}
-(void)CloseKeyBoard:(UITapGestureRecognizer *)gesture{
for (id object in self.view.subviews) {
if ([object isKindOfClass:[UITextField class]]) {
UITextField *textfield=object;
if ([textfield isFirstResponder]) {
[textfield resignFirstResponder];
}
}
}
//[self.view endEditing:YES];
}
标签:io ar os sp for on cti bs ad
原文地址:http://www.cnblogs.com/zhibin/p/4114499.html