Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set a background image to label

Tags:

ios

uilabel

I want to display a number on image like badge of size 30*28, which is placed upon button image,

I have an badge image to set up on the top of button image.. on top of badge image I should able to display text or number and my badge size is 30*28.

so, for this to achieve I want to set a label on top of my button image and so I want to set label background to some image called badge image.

like image 754
Linux world Avatar asked Nov 29 '22 05:11

Linux world


1 Answers

found this in stack overflow itself as the above code just gives the background without the label

was useful for me so sharing

theLabel.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"blah"]];

See: Adding Background image to UILabel

like image 123
darkmystel Avatar answered Dec 06 '22 23:12

darkmystel