Hi Judah,

I really do not get the Adobe folks reasoning why "textAlign" style was
excluded from Spark Buttton.

BTW, the binding of "textAlign" style property in your custom skin via
{getStyle('textAlign')} is redundant.

The <s:Label> inside Button's skin would inherit the value set
from "textAlign" style from <s:Button>, because  <s:Label> will have no
explicit value set to "textAlign" in our custom skin

e.g


<s:SparkSkin>
...
<s:Label id="labelDisplay"
             verticalAlign="middle"
             maxDisplayedLines="1"
             horizontalCenter="0" verticalCenter="1"
             left="10" right="10" top="2" bottom="2">
    </s:Label>
</s:SparkSkin>

--
Best regards,
Andriy Panas



On 18 May 2010 07:53, dorkie dork from dorktown <
dorkiedorkfromdorkt...@gmail.com> wrote:

>
>
> 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 <a.pa...@gmail.com> 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
>>
>
>  
>

Reply via email to