I have simple View based application. I had taken only UILabel
on it.
Following is my code in viewDidLoad:
lblBack.textColor = [UIColo
Dhiren try this code :
UIImage *img = [UIImage imageNamed:@"cab.png"];
CGSize imgSize = testLabel.frame.size;
UIGraphicsBeginImageContext( imgSize );
[img drawInRect:CGRectMake(0,0,imgSize.width,imgSize.height)];
UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
testLabel.backgroundColor = [UIColor colorWithPatternImage:newImage];
I have tested this code.