对 UIView 进行分层,以便可以看到最底层
我有一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
除了将
backgroundColor
设置为[UIColor clearColor]
之外,您还必须设置In addition to setting the
backgroundColor
to[UIColor clearColor]
, you also have to set将 UIScrollView.alpha 级别更改为 0.0f
Change the UIScrollView.alpha level to 0.0f