Hi Andriy,
Yes. You will need to create a custom skin. You can base it on the Button
skin. In the skin you can use the following code:
<s:Label
id="labelDisplay"
textAlign="getStyle('textAlign')"
left="2" right="2" top="2" bottom="2"/>
</s:Skin>
And you must set the style in CSS. The other way to set it is to extend
Button and add a property for text alignment. Then you can set it in MXML.
JP
On Mon, May 17, 2010 at 3:25 AM, Andriy Panas <[email protected]> wrote:
>
>
> Hi all,
>
> "textAlign" style is excluded for Spark Button, and probably for a good
> reason.
>
> [Exclude(name="textAlign", kind="style")]
>
> If I want to align Spark Button text label to the left, should I
> create custom skin to accomplish that?
>
> Something e.g:
>
> <?xml version="1.0" encoding="utf-8"?>
> <s:Skin 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="21" minHeight="21"
> alpha.disabled="0.5">
> .......
>
> <s:Label
> id="labelDisplay"
> textAlign="left"
> left="2" right="2" top="2" bottom="2"/>
> </s:Skin>
>
> --
> Best regards,
> Andriy Panas
>
>