【发布时间】:2016-01-21 17:55:00
【问题描述】:
我试图在另一个视图控制器上显示一个视图控制器,其中上部是透明的,底部会产生这种模糊效果。
发生的事情是我在呈现的视图中看到黑色背景,尽管它的颜色很清晰。
我也读过这里,并且完全一样: Display clearColor UIViewController over UIViewController
//to present
PillView *pillv=[[PillView alloc]initWithPill:pill WithNum:num];
pillv.delegate=self;
UIVisualEffect *blurEffect;
blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
UIVisualEffectView *visualEffectView;
visualEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
visualEffectView.frame=CGRectMake(0, 0, self.view.frame.size.width, [Globals sharedGlobals].titleHeight*self.view.frame.size.height);
[self.view addSubview:visualEffectView];
self.modalPresentationStyle = UIModalPresentationCurrentContext;
[self presentViewController:pillv animated:NO completion:nil];
【问题讨论】:
-
你是用模拟器还是设备测试?
-
模拟器,有问题吗?
-
也检查了设备不工作..
-
所以你想让 pillView 透明?
-
是的。它实际上是透明的,我将它的背景设置为清除
标签: ios objective-c