首页 > 解决方案 > 使用 colorWithPatternImage 为 UIView 着色

问题描述

我需要使用重复的图案图像,但同时我需要对其进行着色

使用时

self.dividerView.tintColor = [UIColor redColor];
self.dividerView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"divider"]];

未应用 tint color ,这是可以理解的,但是如何使用 pattern 功能以及 tint color 功能?(例如有一个有色图案图像)

PS:图片当然是模板图片

标签: cocoa-touchuiviewuiimageuicolor

解决方案


推荐阅读