Html 在Flex中,有没有一种简单的方法可以使中心对齐的标签以相对均匀的方式换行?
设想一个标签如下所示:Html 在Flex中,有没有一种简单的方法可以使中心对齐的标签以相对均匀的方式换行?,html,css,actionscript-3,flash,apache-flex,Html,Css,Actionscript 3,Flash,Apache Flex,设想一个标签如下所示: The Name of Some Corporation from Some State The Name of Some Corporation from Some State 如果希望标签自动包装指定给它们的任何文本,其方式更像: The Name of Some Corporation from Some State The Name of Some Corporation f
The Name of Some Corporation from Some
State
The Name of Some
Corporation from Some State
如果希望标签自动包装指定给它们的任何文本,其方式更像:
The Name of Some Corporation from Some
State
The Name of Some
Corporation from Some State
如果线路更加均匀,有没有简单的方法?我一直在努力使我自己的类有效地以编程的方式完成这项工作,但这花费了我很多时间在研究上。也许有更简单的方法?我想知道如何嵌入CSS/HTML?据我所知,没有。换行通常是通过尽可能多地将内容放在一行上,并将不能放在下一行上的内容移动。您最好使用
justify
,这样会占用每行的全部宽度,或者减少标签的宽度
我想您也可以扩展标签
,并添加您自己的选项或重写Word Wrap出现的方式,但我不建议这样做。我最近试图编写一个截断公式,找出一个单词在一行中的位置或它在哪一行是AS3中的一大难题。显然,它在TextArea
上监听FlexEvent.CREATION\u COMPLETE
,然后拉出它的TextField
并调用getLineIndexOfChar()
会让您知道换行符在哪里。