@interface RootViewController : UIViewController
{  
    UIView        *view;
}

 

-(void)createBackgroundView
{
    view = [[UIView alloc]initWithFrame:self.view.frame];
    view.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.0];
    view.opaque = NO;

UIWindow *appWindow = [[UIApplicationsharedApplication] keyWindow];


[appWindow addSubview:view]; //覆盖全屏


    [self.view addSubview:view];
    [UIView animateWithDuration:0.2 animations:^{
        view.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.25];
    }];
}

 

相关文章:

  • 2021-11-21
  • 2022-01-07
  • 2021-06-21
  • 2021-10-16
  • 2021-12-06
  • 2021-11-16
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案