iOS UIlabel添加背景图片

原文地址::https://blog.csdn.net/lovenjoe/article/details/7532033

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

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

[myLabel setBackgroundColor:color];

发布了136 篇原创文章 · 获赞 306 · 访问量 437万+

猜你喜欢

转载自blog.csdn.net/xqhrs232/article/details/90294575