UIlabel添加背景图片

做UI的时候我们可能想给某个Label添加一个背景图片,但查看的时候会发现好像只有设置背景颜色的方法,不过我们也可以通过这种方式来解决:

UIColor *color = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background.png"]];

[myLabel setBackgroundColor:color];
原文地址:https://www.cnblogs.com/hacjy/p/5124416.html