如何在 Spark TextArea 中设置边框颜色?

How do I set the border color in a Spark TextArea?

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

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

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

您需要设置样式如下:

<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>

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