(转)【iOS】 iOS 使用View 为屏幕增加一个全屏的蒙层

 转自:http://blog.csdn.net/qq_30963589/article/details/50580872

+(UIView*)addCoverView{
    
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)];
    view.backgroundColor = [UIColor blackColor];
    view.alpha = 0.5;
    [[UIApplication sharedApplication].keyWindow addSubview:view];
    
    return view;
}

+(void)removeCoverView:(UIView*)view{
    [view removeFromSuperview];
}

猜你喜欢

转载自jameskaron.iteye.com/blog/2361258

相关文章