UIImageView不支持图片平铺,通过设置颜色纹理,会有平铺效果。
UIImage* bgImage = [UIImage imageNamed:@"bg.png"];
[self.view setBackgroundColor:[UIColor colorWithPatternImage:bgImage]];
本文介绍如何使用UIImageView实现图片平铺效果。通过设置颜色纹理而非直接使用UIImageView, 可以达到期望的平铺背景效果。
UIImageView不支持图片平铺,通过设置颜色纹理,会有平铺效果。
UIImage* bgImage = [UIImage imageNamed:@"bg.png"];
[self.view setBackgroundColor:[UIColor colorWithPatternImage:bgImage]];
被折叠的 条评论
为什么被折叠?