私は1つのアプリケーションを開発しています。その中で、UIlabelの背景として画像を追加しました。その後、UILabelのテキストを指定しますが、テキストが表示されません。背景画像付きのラベルのテキストを表示する方法を教えてください。 。以下は、画像を背景として設定するためのコードです。
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"]];