UIlabel添加背景图片

UIlabel添加背景图片

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

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

猜你喜欢

转载自stephen830.iteye.com/blog/2240471