对 UIView 进行分层,以便可以看到最底层

发布于 2024-09-28 22:54:21 字数 216 浏览 1 评论 0原文

我有一个 UIView,我在其中添加了背景图像。然后我向该视图添加一个滚动视图。我在滚动视图中添加了一些 UIButtons。

我希望能够将滚动视图设置为透明(仍然能够看到 UIButtons),以便我可以看到其下方的背景图像,以便它显示在按钮之间。

我尝试将滚动视图背景设置为 [UIColor clearColor] 但这不起作用。

谢谢。

I have a UIView to which i add a background image. Then to that view i add a scroll view. To the scroll view i add some UIButtons.

I would like to be able to set the scroll view to be transparent (still being able to see the UIButtons) so that i can see the background image underneath it, so that it shows between the buttons.

I have tried setting the scrollview background to [UIColor clearColor] but this doesnt work.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

放我走吧 2024-10-05 22:54:22

除了将 backgroundColor 设置为 [UIColor clearColor] 之外,您还必须设置

scrollView.opaque = NO;

In addition to setting the backgroundColor to [UIColor clearColor], you also have to set

scrollView.opaque = NO;
躲猫猫 2024-10-05 22:54:22

将 UIScrollView.alpha 级别更改为 0.0f

Change the UIScrollView.alpha level to 0.0f

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文