I am developing one applciation.In that i added the image as background for UIlabel.And after that i give the text for UILabel.But it doesn’t show the text.So please tell me how to show the text for label with background image. Below one is the code for set the image as background.
UIImage *ansimage=[UIImage imageNamed:@"AnswerBox_standard.png"];
UILabel *a1=[UILabel alloc]init];
a1.frame=CGRectMake(10, 160, ansimage.size.width, ansimage.size.height);
a1.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"AnswerBox_standard.png"]];
You can add such a image which has text on it, which you wanted to show on that label. OR You can first add imageview and then add label on it ,but make sure to set label’s background color as [UIColor clearcolor].