UIlabel添加背景图片

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

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

[myLabel setBackgroundColor:color];

 

posted @ 2016-01-12 15:14  ha_cjy  阅读(857)  评论(0编辑  收藏  举报