开发者

How do you add a drop cap style image at the beginning of a multiline iPhone UILabel?

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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜