很简单,就是一句话,就可以搞定:
view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageWithContentsOfFile:path]];
本文介绍了一种简单的方法来设置视图的背景图片,只需一行代码即可实现。具体做法是使用UIColor的 colorWithPatternImage 方法结合 UIImage 的 initWithContentsOfFile 方法。
很简单,就是一句话,就可以搞定:
view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageWithContentsOfFile:path]];

被折叠的 条评论
为什么被折叠?