- (BOOL)prefersStatusBarHidden{ return YES;//隐藏为YES,显示为NO}
- (void)tapClick:(UITapGestureRecognizer *)sender { [self.imageView1 removeFromSuperview]; [self.backgroundView removeFromSuperview];}//imageView1是二维码图片-(void)downBtnClick{ UIView *backgroundView = [[UIView alloc] init]; self.backgroundView = backgroundView; backgroundView.frame = CGRectMake(0, 0,kScreenWidth,kSCreenHeight); backgroundView.backgroundColor = [UIColor colorWithRed:(40/255.0f) green:(40/255.0f) blue:(40/255.0f) alpha:1.0f]; backgroundView.alpha = 0.7; backgroundView.userInteractionEnabled = YES; UITapGestureRecognizer *tap3 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapClick:)]; tap3.numberOfTapsRequired = 1; // 点几下 tap3.numberOfTouchesRequired = 1; // 几根手指 // 2.对某一个需要添加手势的view 添加手势 [backgroundView addGestureRecognizer:tap3]; [self.window addSubview:backgroundView]; [self.window addSubview:self.imageView1];}