How do you remove the border of a Flex 4 TextArea Component (spark themed halo)
Asked Answered
A

7

5

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.

Allred answered 25/6, 2009 at 17:29 Comment(0)
A
1

You have to set the borderSkin to null

<mx:TextArea borderSkin={null} />
Allred answered 25/6, 2009 at 19:33 Comment(1)
The question is about spark.components.TextArea, not mx.controls.TextAreaDelldella
S
9

Try something like:

borderVisible="false"
Schrock answered 7/1, 2010 at 7:35 Comment(0)
H
2

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>
...
Hydrotherapeutics answered 21/12, 2012 at 18:20 Comment(0)
A
1

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

Accommodative answered 25/6, 2009 at 17:34 Comment(0)
A
1

You have to set the borderSkin to null

<mx:TextArea borderSkin={null} />
Allred answered 25/6, 2009 at 19:33 Comment(1)
The question is about spark.components.TextArea, not mx.controls.TextAreaDelldella
A
0

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!

Assurbanipal answered 1/12, 2010 at 23:39 Comment(0)
T
0

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

Theomorphic answered 7/7, 2011 at 11:34 Comment(0)
C
0

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.

Chorus answered 22/10, 2013 at 3:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.