iOS 模态推出presentViewController半透明
2018-02-27 本文已影响11人
啵啵_long_港
UIViewController *vc = [[UIViewController alloc] init];
vc.view.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
nav.modalPresentationStyle = UIModalPresentationOverCurrentContext;
nav.view.backgroundColor = [UIColor clearColor];
[self presentViewController:nav animated:YES completion:nil];