弹出view背景半透明的控制器,用于实现类似于自定义弹出框(带蒙版),

//弹出view背景半透明的控制器,用于实现类似于自定义弹出框(带蒙版),

UIViewController *rootControler=self.view.window.rootViewController;
       
    TestViewController *test=[[TestViewController alloc] init];
   
    test.view.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.8];
   
    rootControler.modalPresentationStyle=UIModalPresentationCurrentContext;
   
    [rootControler presentViewController:test animated:YES completion:nil];

猜你喜欢

转载自tlin.iteye.com/blog/2179719