如何删除 Flex 4 TextArea 组件的边框(spark 主题光环)

发布于 2024-07-26 00:44:36 字数 107 浏览 8 评论 0原文

使用 Flex 3 SDK,您只需将 borderThickness 样式设置为 0,或将 borderStyle 设置为 none。 对于 Flex 4 SDK 和 Spark 主题,这没有效果。

With the Flex 3 SDK you simply needed to set the borderThickness style to 0, or set borderStyle to none. With the Flex 4 SDK ad the Spark theme, this has no effect.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

琴流音 2024-08-02 00:44:36

尝试类似的方法:

borderVisible="false"

Try something like:

borderVisible="false"
慈悲佛祖 2024-08-02 00:44:36

如果您想从 spark TextArea 中删除边框,可以使用以下几种方法:
要使所有 Spark TextAreas 没有边框,您可以这样做:

s|TextArea {
  borderVisible : false;
}

您还可以制作一个简单的样式,然后仅将它们应用到特定的 Spark TextAreas,如下所示:

.noBorder {
  borderVisible : false;
}
...
<s:TextArea styleName="noBorder"/>

您可以通过创建完成将其关闭,如下所示:

<s:Application ...
  creationComplete="onCreationComplete()"/>
...
private function onCreationComplete() : void {
  mySparkTextArea.setStyle('borderVisible', false);
}
...
<s:TextArea id="mySparkTextArea"/>
</s:Application>

最后,您可以制作皮肤,根据 DrMaxmAd 的建议,如下所示:

...
<!-- border/fill --> 
<s:Rect left="0" right="0" top="0" bottom="0">
    <s:stroke>
        <s:SolidColorStroke color="#5C5C5C" weight="1" alpha="0"/>            
    </s:stroke>
    <s:fill>
        <s:SolidColor color="#FFFFFF"/>
    </s:fill>
</s:Rect>
...

If you want to remove the border from spark TextArea's here are some ways to do so:
To make all spark TextAreas have no border you can do this:

s|TextArea {
  borderVisible : false;
}

You can also make a simple style and only apply them to specific spark TextAreas like so:

.noBorder {
  borderVisible : false;
}
...
<s:TextArea styleName="noBorder"/>

You can turn it off via creation complete like so:

<s:Application ...
  creationComplete="onCreationComplete()"/>
...
private function onCreationComplete() : void {
  mySparkTextArea.setStyle('borderVisible', false);
}
...
<s:TextArea id="mySparkTextArea"/>
</s:Application>

Finally, you can make a skin, per DrMaxmAd's suggestion, like so:

...
<!-- border/fill --> 
<s:Rect left="0" right="0" top="0" bottom="0">
    <s:stroke>
        <s:SolidColorStroke color="#5C5C5C" weight="1" alpha="0"/>            
    </s:stroke>
    <s:fill>
        <s:SolidColor color="#FFFFFF"/>
    </s:fill>
</s:Rect>
...
温暖的光 2024-08-02 00:44:36

我还没有涉足 Flash Builder 4,但我知道在 Flex 3 中您可以修改如下内容(当其他方式不可能时):

var tb:TextInput = new TextInput();
tb.getChildAt(0).setStyle(...);

可能想尝试一下,您通常只需要找到正确的子元素。

编辑这是您的答案

I haven't dabbled in Flash Builder 4 yet, but I know in Flex 3 you can modify things like this (when its not possible another way):

var tb:TextInput = new TextInput();
tb.getChildAt(0).setStyle(...);

Might want to give this a try, you just need to find the correct child element usually.

EDIT: Here's your answer

只有一腔孤勇 2024-08-02 00:44:36

您必须将 borderSkin 设置为 null

<mx:TextArea borderSkin={null} />

You have to set the borderSkin to null

<mx:TextArea borderSkin={null} />
戏剧牡丹亭 2024-08-02 00:44:36

Jeol,您的答案适用于 MX 组件,对于 Flex 4 Spark textarea 组件,您设置 borderVisible="false" 并在代码 lblMessage.setStyle("contentBackgroundAlpha", 0); 中设置

另外,如果你这样做,你可能希望黑客让该死的东西自动调整其内容...设置 heightInLines="{NaN}"

<s:TextArea borderVisible="false" focusEnabled="false" width="100%" id="lblMessage" heightInLines="{NaN}"  editable="false" selectable="true" lineBreak="toFit" verticalScrollPolicy="off" horizontalScrollPolicy="off" />

protected function OnCreationComplete(objEvent:Event):void{
   lblMessage.setStyle("contentBackgroundAlpha", 0);
 }

...感谢 RobotLegs,它太棒了!

Jeol your answer works for MX components, for the flex 4 spark textarea component you set borderVisible="false" and in code lblMessage.setStyle("contentBackgroundAlpha", 0);

Also, if your doing this, you probably want the hack to make the damn thing autosize to it's content... set heightInLines="{NaN}"

<s:TextArea borderVisible="false" focusEnabled="false" width="100%" id="lblMessage" heightInLines="{NaN}"  editable="false" selectable="true" lineBreak="toFit" verticalScrollPolicy="off" horizontalScrollPolicy="off" />

protected function OnCreationComplete(objEvent:Event):void{
   lblMessage.setStyle("contentBackgroundAlpha", 0);
 }

...and Thanks for RobotLegs, it's freaking awesome!

空城旧梦 2024-08-02 00:44:36

好吧,我已经尝试了上面的代码,但它对我的 Flex Hero SDK 4.5 不起作用,所以我选择了 textArea 并创建了一个新的自定义皮肤并将边框 alpha 更改为 0。

<!-- border/fill --> 
    <s:Rect left="0" right="0" top="0" bottom="0">
        <s:stroke>
            <s:SolidColorStroke color="#5C5C5C" weight="1" alpha="0"/>            
        </s:stroke>
        <s:fill>
            <s:SolidColor color="#FFFFFF"/>
        </s:fill>
    </s:Rect>

简单而甜蜜

well i have tried the above code but it does not work for me Flex Hero SDK 4.5, so what i did i selected the textArea and created a new custom skin and change the border alpha to 0.

<!-- border/fill --> 
    <s:Rect left="0" right="0" top="0" bottom="0">
        <s:stroke>
            <s:SolidColorStroke color="#5C5C5C" weight="1" alpha="0"/>            
        </s:stroke>
        <s:fill>
            <s:SolidColor color="#FFFFFF"/>
        </s:fill>
    </s:Rect>

simple and sweet

你是我的挚爱i 2024-08-02 00:44:36

在 Flex 3 中: TextArea 组件的边框可以通过使用以下两个属性/属性进行控制:

  • borderSkin="{null}"
  • focusAlpha="0"

Focus alpha 确保即使 TextArea 处于打开状态也不会显示边框已选择。

In Flex 3: The border for TextArea component can be controlled by using these two attributes/properties:

  • borderSkin="{null}"
  • focusAlpha="0"

Focus alpha ensures that you don't get the border showing up even when the TextArea is selected.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文