简体   繁体   English

如何使用Interface Builder在视图中设置背景图像

[英]How to set a background image in view using Interface Builder

嗨我想在我的视图中设置一个背景图像,它有几个子视图。

My approach to this is to: 我的方法是:

  1. Add a UIImageView as a sibling to your subviews that is the size of the main view, and apply your Image to this view. 将UIImageView作为同级添加到子视图中,即主视图的大小,然后将Image应用于此视图。
  2. All sibling views set the Background color to have an alpha of 0. This will make the view transparent, but not affect any elements they contain. 所有同级视图都将背景颜色设置为alpha为0.这将使视图透明,但不会影响它们包含的任何元素。

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

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