简体   繁体   English

使透明的UIView后面的UIView不可见

[英]Make UIView behind transparent UIView invisible

I have a transparent view with alpha set to 0.3, and behind it there are some views, is there any option in IOS to set some of the views that are behind my transparent view to hidden? 我有一个透明的视图,alpha设置为0.3,在它的后面有一些视图,IOS中是否有任何选项可以将透明视图后面的某些视图设置为隐藏?

I need when half of the view is behind the transparent, and the other half is not, to show only half of the view 我需要当视图的一半在透明物体后面,而另一半不在时,只显示一半视图

您可以在建立IBOutlet连接后将其隐藏

[yourView setHidden:YES];

You can set the hidden property of the unwanted views to YES if you want to hide them. 您可以设置hidden到不必要的看法财产YES ,如果你想隐藏起来。

You can set the alpha to 0. 您可以将alpha设置为0。

You can also [myView removeFromSuperView] if it makes sense. 如果[myView removeFromSuperView]您也可以[myView removeFromSuperView]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM