废话少说:presentViewController背景色透明。
ShowResultsViewController *vc = [ShowResultsViewController new];
vc.passDict = dict0;
vc.view.backgroundColor=[UIColor colorWithWhite:0 alpha:0.4];
//关键语句,必须有
vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
[self presentViewController:vc animated:YES completion:^(void){
vc.view.superview.backgroundColor = [UIColor clearColor];
}];

本文介绍了如何在Swift中使用UIModalPresentationOverFullScreen样式,将ShowResultsViewController以透明背景全屏显示,并通过view.backgroundColor设置为白色不透明度0.4来实现背景透明效果。


被折叠的 条评论
为什么被折叠?



