ios 添加朦层

@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];
}];
}
上一篇:苹果应用商店逾千款iOS应用存安全漏洞


下一篇:iOS系统中导航栏的转场解决方案与最佳实践