首页
\
问答
\
如何使用不透明的UIView作为半透明UIView的子视图?(How can I have an opaque UIView as a subview of a semi-transparent UIView?)
如何使用不透明的UIView作为半透明UIView的子视图?(How can I have an opaque UIView as a subview of a semi-transparent UIView?)
我有一个UIView的alpha为0.5,我添加为我的主视图的子视图,以灰色的一切。 我想添加一个额外的UIView到这个灰色的UIView作为一个子视图 - 问题是,当我这样做,我新增的子视图也是部分透明。
有没有办法使子视图“忽略”其超级视图的alpha值,并且本身完全不透明?
I have a UIView with an alpha of 0.5 which I add as a subview to my primary view in order to gray-out everything else. I want to add an additional UIView to this gray UIView as a subview - the problem is that when I do this, my newly-added subview is also partially transparent.
Is there any way to make a subview "ignore" the alpha value of its superview and be itself fully opaque?
原文:https://stackoverflow.com/questions/6112220
更新时间:2022-04-02 17:04