标签:
- (void)viewDidLoad { [super viewDidLoad]; [self addTapForView]; } - (void)addTapForView { UITapGestureRecognizer *tapGestureRecognizer =[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(backupgroupTap:)]; tapGestureRecognizer.numberOfTapsRequired =1; [self.view addGestureRecognizer:tapGestureRecognizer]; [tapGestureRecognizer setCancelsTouchesInView:NO]; } -(void)backupgroupTap:(id)sender{ [self.view endEditing:YES]; }
标签:
原文地址:http://www.cnblogs.com/songxing10000/p/4457364.html