标签:style blog io color os ar sp div on
UIViewController *viewController = [[UIViewController alloc]init]; UIViewController* controller = self.view.window.rootViewController;
viewController.view.backgroundColor = [UIColor blackColor]; viewController.view.alpha = 0.5f; controller.modalPresentationStyle = UIModalPresentationCurrentContext; [controller presentViewController:viewController animated:NO completion:nil];
UIViewController 页面
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapGesture:)];
[self.view addGestureRecognizer:tapGesture];
- (void)tapGesture:(UITapGestureRecognizer *)gesture
{
[self dismissViewControllerAnimated:YES completion:nil];
}
在iOS上present一个半透明的viewController
标签:style blog io color os ar sp div on
原文地址:http://www.cnblogs.com/joesen/p/4062533.html