开发者

Flex htmlText cuts off multiple lines from the bottom if you add an <img />

For some reason, if you add an image to htmlText, like the following:

myText.htmlText = "<img src='"+dataProvider.bodyImage.getUrl('original')+"' align='left' \/>" + dataProvider.bodyText;

The image will be succesfully added to the htmlText, but it seems to measure the sizes completely wrong. At times, the actual text (dataProvider.bodyText) will have part 'hidden' under the image. At other times, there are anywhere from 1 to 4 lines cut off at the bottom. Howe开发者_JS百科ver, if you select the text and drag your mouse down, you can see the bottom lines. It appears the text is all there, but the mx:Text component is not including the image in the textHeight, so it doesnt resize the componenet to the correct size.

Any ideas?

Currently using: Flex 3 (cannot upgrade to 4, unfortunately).

Thanks so much!


The key is you have to specify the width/height of the image in htmlText in order for it to be calculated correctly (or close to it, anyway).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜