如何创建自定义平铺图像?

发布于 2024-12-23 12:49:56 字数 113 浏览 2 评论 0原文

我有一个小尺寸的图像,我想获得一个具有不同数量的该小尺寸图像的图像。我首先为每个图像创建一个 uiimageview ,但进展并不顺利。

那么有没有一个简单的解决方案呢?

I have a small-sized image and I want to obtain an image which has various numbers of this small-sized image. I've started by creating an uiimageview for each image but it didn't go well.

So is there an easy solution for this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

虐人心 2024-12-30 12:49:56

假设您的图像名为 pattern.png 并且您想要将平铺作为背景添加到 UIView:

- (void)viewDidLoad {
  [super viewDidLoad];
  UIImage *patternImage = [UIImage imageNamed:@"pattern.png"];
  self.view.backgroundColor = [UIColor colorWithPatternImage:patternImage];
}

Assume your image is named pattern.png and you want to add the tiled as background to a UIView:

- (void)viewDidLoad {
  [super viewDidLoad];
  UIImage *patternImage = [UIImage imageNamed:@"pattern.png"];
  self.view.backgroundColor = [UIColor colorWithPatternImage:patternImage];
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文