自定义弹框,背景半透明

点击控制器1的cell 弹出ChooseSomeTypesVC

- (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath

{

ChooseSomeTypesVC*vc = [[ChooseSomeTypesVC alloc]init];

vc.providesPresentationContextTransitionStyle=YES;

vc.definesPresentationContext=YES;

vc.modalPresentationStyle=UIModalPresentationOverCurrentContext;

vc.delegate=self;

vc.rows= [NSString stringWithFormat:@"%ld", indexPath.row];

[self presentViewController:vcanimated:YES completion:nil];

}

//

ChooseSomeTypesVC.m

- (void)viewDidLoad {

[superviewDidLoad];

self.view.backgroundColor= [[UIColorblackColor]colorWithAlphaComponent:0.5];

UIView*bottomView = [[UIViewalloc]initWithFrame:CGRectMake(100,100,100,260)];

bottomView.backgroundColor= [UIColorwhiteColor];

[self.viewaddSubview:bottomView];

}

你可能感兴趣的:(自定义弹框,背景半透明)