[英]How can set the background of the moda view to be Translucent?
I call my ModalViewController by tapping into a Button. 我通过点击一个按钮来调用我的ModalViewController。 I want this ModalViewController have a Translucent background like below: 我希望此ModalViewController具有如下的半透明背景:
when i use [self.view setBackgroundColor:[UIColor clearColor]]; 当我使用[self.view setBackgroundColor:[UIColor clearColor]]; it gives me a black background: 它给了我黑色背景:
[modalView.view setBackgroundColor:[UIColor clearColor]];
或者如果您想降低不透明度
[modalView.view setalpha:0.4]; //range is from 0(transparent) to 1(opaque)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.