How do you add an image in the beginning of a multiline iPhone UILabel so that it starts the first line of text but doesn't disrupt the flow of the second/third/etc line of text?
Asked
Active
Viewed 382 times
1 Answers
0
This cannot be done with a UILabel
. To accomplish this, you're going to have to have the image with a UILabel to the right of it, and another UILabel
below those that spans the full width. And you'll have to calculate how much of the text can be shown in the first UILabel
, so that you know what text to put in the bottom label. UILabel visible part of text should give you an idea of what you'll need to do to calculate how much of the text is visible in the first label.
Not an easy task, but it's doable.

Community
- 1
- 1

Ray Lillywhite
- 746
- 5
- 12
-
Fair enough. That's what I ended up doing. I might try a subclass at some point, but I went the quick and dirty route for now. Thanks! – Mr. T Feb 11 '11 at 02:21