近來chowky 工作上需要利用textarea, text 上面的htmltext 的property,用來支援html。
誰不知~原來flex 3 對html的支援真的非常有限
只是支援以下的tag,看來去好像很多,但連最基本的table都不支援。
- Anchor tag (<a>)
- Bold tag (<b>)
- Break tag (<br>)
- Font tag (<font>)
- Image tag (<img>)
- Italic tag (<i>)
- List item tag (<li>)
- Paragraph tag (<p>)
- Text format tag (<textformat>)
- Underline tag (<u>)
最大問題是image tag 可用程度非常低。
很多的adobe 以知的bugs 都是關於htmltext 的。
所以chowky最尾都是放棄了img tag. 直接parse image,再譯成image class。反而更順利。
(哈,有同事被迫要用..慘…搞到非常大問題,以及用了不少”workaround” 才可以”解決”)
Note: The <img>
tag is not fully supported, and might not work in some cases. (這麼寫法是否想提醒你,不一定可行,自己好自為之)
連官方的documentation 都這樣,灰心~
其實已經有不少人都同樣遇到這個問題,但都沒有解決方法,只不過值得一看會有什麼問題(如果你還堅決用html img)
http://geekglue.blogspot.com/2007/02/hacking-htmltext-in-flex-2.html
Srouce: http://blog.flexcommunity.net/?p=38
不過adobe 新出的text layout framework 看來應該可以解決以上的問題。有希望~~
Flex 3 方面,不知道這個新的component for workaround (新的component) 會否比現在的workaround 更好?
Source: http://www.leeftpaulnog.nl/2009/02/flash-htmltext-or-how-to-display-images.html


Recent Comments