1. 程式人生 > >隱藏電池欄,遮罩層

隱藏電池欄,遮罩層

idt col interact btn pcl blog num selector select

- (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]; }

隱藏電池欄,遮罩層