如何设置此 Detail View Alpha 1.0,在 ios 中不透明?

How to set this Detail View Alpha 1.0 , non transparent in ios?

当我点击共享按钮时。打开Share_view。及其 alpha 0.5,但我在共享视图上添加了另一个视图。

但我想要这个视图 alpha 1.0,它不透明我想看到全白。

See my Image

我试过这个,但这根本不起作用:

[Detail_view setBackgroundColor:[[UIColor White] colorWithAlphaComponent:1.0]];

据我了解,您是在 Share_view 上添加 Detail_view,因此 Share_view 是 Detail_view 的父级。

解决方案 - 使 Detail_view 成为 self.view 的子视图,即

[self.view addSubview:Detail_view];

如果你想在 Share_view 上 Detail_view,你可以这样做:

不要直接在父视图上设置 alpha。而是使用

[Share_view setBackgroundColor:[[UIColor whiteColor] colorWithAlphaComponent:0.5]];

现在任何子视图都可以有自己的颜色并且不会透明。