gpt4 book ai didi

ios - 将大小为 10x10 的 UIImageView 设置为 UIView 的背景

转载 作者:行者123 更新时间:2023-11-28 20:21:41 25 4
gpt4 key购买 nike

我的图像大小为 10x10 像素,我需要将图像设置为 UIView 的背景,图像水平和垂直复制,而不是拉伸(stretch)。 ios可以吗?

最佳答案

你可以这样做:

view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bodyBG"]];

默认水平和垂直复制。

关于ios - 将大小为 10x10 的 UIImageView 设置为 UIView 的背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15652707/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com