【问题标题】:How do I set the border color in a Spark TextArea?如何在 Spark TextArea 中设置边框颜色?
【发布时间】:2015-05-12 07:24:18
【问题描述】:

如何在 Spark TextArea 中设置边框颜色? Spark TextArea 中没有borderColor 的属性样式。

<s:TextArea id="textarea" borderColor="0"/>

【问题讨论】:

    标签: apache-flex flex4


    【解决方案1】:

    你需要设置样式如下图:

    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                   xmlns:s="library://ns.adobe.com/flex/spark" 
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
        <fx:Style>
            @namespace s "library://ns.adobe.com/flex/spark";
            @namespace mx "library://ns.adobe.com/flex/mx";
    
            s|TextArea#txtArea1 {
                borderColor: red;
            }
    
        </fx:Style>
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <s:TextArea id="txtArea1" width="500" height="500" skinClass="MyCustomTextAreaSkin">
    
        </s:TextArea>
    </s:Application>
    

    如果您还有其他要求,那么最好使用自定义皮肤。这个例子输出你想要的。

    【讨论】:

    • 我已经接受了你的回答,但它也可以内联。内联的问题是它没有显示在自动完成中。
    【解决方案2】:

    由于某种原因,编译器不知道这个样式属性。它不像其他样式那样自动完成,但也不会引发错误。它似乎在运行时工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-24
      • 1970-01-01
      • 2014-12-14
      • 2013-06-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多