[英]How to set the background image of the main view in XCode storyboard editor?
I am trying to set a background image for my main superview in the story board editor without creating another view(just for a background image). 我试图在故事板编辑器中为我的主要超级视图设置背景图像,而不创建另一个视图(仅用于背景图像)。 I can change the class of my main view to UIImageView, but the editor will not show me the option to specify a background image.
我可以将主视图的类更改为UIImageView,但编辑器不会向我显示指定背景图像的选项。 How can I make this work?
我怎样才能做到这一点?
It is possible, but you won't get visual feedback from the storyboard. 这是可能的,但您不会从故事板获得视觉反馈。 Under the Identity inspector (cmd+option+3), there is a pane for setting user-defined runtime attributes, and setting the
backgroundColor
to a [UIColor colorWithPatternImage:]
should work just fine. 在Identity检查器(cmd + option + 3)下,有一个用于设置用户定义的运行时属性的窗格,将
backgroundColor
设置为[UIColor colorWithPatternImage:]
应该可以正常工作。 I would however, for clarity, keep that sort of stuff in the viewDidLoad
-method 但是,为了清楚起见,我会在
viewDidLoad
-method中保留那种东西
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.