Adding a background image to UILabel

I am trying to add a UIImageView to the UILabel subtitle, but for some reason I cannot use it as a background, as this will cover the label text.

I do not want to set the background color of the UILabel, because it will be repeated as a pattern:

[self setBackgroundColor: [UIColor colorWithPatternImage:[UIImage imageNamed:@"someBg.png"]]];

Looking at the number of subtasks on the raw UILabel, it seems that the text is not a UIView, so adding a subview to index 0 won't help either.

I need text to be TOP in the background of the image.

Any ideas?

+3
source share
2 answers

, , UITextField . , UILabel , , .

, , .

+1

:

  • .
  • , .
+5

Source: https://habr.com/ru/post/1782631/


All Articles