UIColor与PatternImage

UIColor有一个方法叫做+ (UIColor *)colorWithPatternImage:(UIImage *)image;
返回的是一个UIColor,但没有明确的RGB值,所以叫做pattern color。

    [color getRed:&a green:&g blue:&b alpha:&a];

可以设置为view的background color,效果就是这幅图平铺开来。

    self.view.backgroundColor = color;

Simulator Screen Shot 2016年10月16日 23.35.12

posted on 2016-10-16 23:39  花老🐯  阅读(1025)  评论(0编辑  收藏  举报

导航