Flex中Label中的字体大小不同?

问题描述 投票:0回答:3

我想在标签中显示一组文本,如“DISCONTINUED(02-02-2012)Crocin”。但我需要较小的字体大小日期。如何将值设置为Label,以便我可以显示Date的较小字体。

我只需要为标签分配一个字符串?像这样“停止(02-02-2012)Crocin”

这是可能的flex?

flex flex4 flex3 flex4.5
3个回答
3
投票

它有可能通过2种方式在FLEX中实现。

(1)

<mx:Text width="550">
    <mx:htmlText>
        <![CDATA[
        <b><font size="26">DISCONTINUED </font><font size="18">(02-02-2012) Crocin</font>
        ]]>
    </mx:htmlText>
</mx:Text>

(2)

在文本区域中嵌入htmlText并按如下方式更改CSS文件,使其感觉像Label。将其可选和可编辑属性更改为false,并且不要忘记给出高度和宽度。

TextArea 
{
    leading: 0;
    backgroundAlpha: 0;
    borderStyle: none;
}

有关更多CSS更改,请访问THIS LINK

祝你今天愉快


0
投票

是的,这可以做到。看看来自Adobes LiveDoc的这份文件:

http://livedocs.adobe.com/flex/3/html/help.html?content=textcontrols_04.html


0
投票
<mx:Text width="550">
        <mx:htmlText>
            <![CDATA[
            <b><font size="26">DISCONTINUED </font><font size="18">(02-02-2012) Crocin</font>
            ]]>
        </mx:htmlText>
</mx:Text>

您也可以在标签中加入htmlText。

<mx:Label width="600" height="100">
        <mx:htmlText>
            <![CDATA[
            <b><font size="26">DISCONTINUED </font><font size="18">(02-02-2012) Crocin</font>
            ]]>
        </mx:htmlText>
    </mx:Label>
© www.soinside.com 2019 - 2024. All rights reserved.