【发布时间】:2017-07-20 12:51:47
【问题描述】:
UIColor *background = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"background.jpg"]];
_mainView.backgroundColor = background;
当我运行此代码时,我将图像作为视图的背景,但喜欢几种模式。我想在不使用 ImageView 的情况下将图像设置为我的视图。 可以通过 stroyboard 做吗?
【问题讨论】:
-
你为什么要做这样的事情? UIImageView 是实现你想要的最简单、最直接的方法。
标签: ios objective-c uiview uiimageview xcode-storyboard