Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>i think you should try <code>labelPlacement</code> or <code>textAlign</code> properties of a Button. you can also add <code>top,left,right,bottom</code> properties to control text postion. hope this will work for you.</p> <p>and if you are adding a <code>&lt;s:label /&gt;</code> in a skin. then you can devide your text to 2 lines by using <code>maxDisplayedLine="2"</code> property of a label component. </p> <p>or try to make a skin like this</p> <pre><code>&lt;s:SparkButtonSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:fb="http://ns.adobe.com/flashbuilder/2009" minWidth="21" minHeight="21" alpha.disabled="0.5"&gt; &lt;fx:Metadata&gt; &lt;![CDATA[ /** * @copy spark.skins.spark.ApplicationSkin#hostComponent */ [HostComponent("spark.components.Button")] ]]&gt; &lt;/fx:Metadata&gt; &lt;fx:Script fb:purpose="styling"&gt; &lt;![CDATA[ import spark.components.Group; /* Define the skin elements that should not be colorized. For button, the graphics are colorized but the label is not. */ static private const exclusions:Array = ["labelDisplay"]; /** * @private */ override public function get colorizeExclusions():Array {return exclusions;} /** * @private */ override protected function initializationComplete():void { useChromeColor = true; super.initializationComplete(); } /** * @private */ override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number) : void { var cr:Number = getStyle("cornerRadius"); if (cornerRadius != cr) { cornerRadius = cr; shadow.radiusX = cornerRadius; fill.radiusX = cornerRadius; lowlight.radiusX = cornerRadius; highlight.radiusX = cornerRadius; border.radiusX = cornerRadius; } if (highlightStroke) highlightStroke.radiusX = cornerRadius; if (hldownstroke1) hldownstroke1.radiusX = cornerRadius; if (hldownstroke2) hldownstroke2.radiusX = cornerRadius; super.updateDisplayList(unscaledWidth, unscaledHeight); } private var cornerRadius:Number = 5; ]]&gt; &lt;/fx:Script&gt; &lt;!-- states --&gt; &lt;s:states&gt; &lt;s:State name="up" /&gt; &lt;s:State name="over" /&gt; &lt;s:State name="down" /&gt; &lt;s:State name="disabled" /&gt; &lt;s:State name="selected" /&gt; &lt;/s:states&gt; &lt;!-- layer 1: shadow --&gt; &lt;!--- @private --&gt; &lt;s:Rect id="shadow" left="0" right="0" top="0" bottom="0" radiusX="0"&gt; &lt;/s:Rect&gt; &lt;!-- layer 2: fill --&gt; &lt;!--- @private --&gt; &lt;s:Rect id="fill" left="1" right="1" top="1" bottom="1" topLeftRadiusX="10" topLeftRadiusY="10" bottomLeftRadiusX="10" bottomLeftRadiusY="10" topRightRadiusX="10" topRightRadiusY="10" bottomRightRadiusX="10" bottomRightRadiusY="10"&gt; &lt;s:fill&gt; &lt;s:LinearGradient rotation="90"&gt; &lt;s:GradientEntry color="0xc9d8e2" color.selected="0xe7f1f8" color.down="0xe7f1f8" color.disabled="0xb4b4b4" color.over="0xdbe9f3" /&gt; &lt;s:GradientEntry color="0xa1bbcd" color.over="0xdbe9f3" color.down="0xe2e9ed" color.disabled="0xb4b4b4" color.selected="0xc8d7e1" /&gt; &lt;/s:LinearGradient&gt; &lt;/s:fill&gt; &lt;/s:Rect&gt; &lt;!-- layer 3: fill lowlight --&gt; &lt;!--- @private --&gt; &lt;s:Rect id="lowlight" left="1" right="1" top="1" bottom="1" topLeftRadiusX="10" topLeftRadiusY="10" bottomLeftRadiusX="10" bottomLeftRadiusY="10"&gt; &lt;/s:Rect&gt; &lt;!-- layer 4: fill highlight --&gt; &lt;!--- @private --&gt; &lt;s:Rect id="highlight" left="1" right="1" top="1" bottom="1" topLeftRadiusX="10" topLeftRadiusY="10" bottomLeftRadiusX="10" bottomLeftRadiusY="10"&gt; &lt;/s:Rect&gt; &lt;!-- layer 5: highlight stroke (all states except down) --&gt; &lt;!--- @private --&gt; &lt;s:Rect id="highlightStroke" left="1" right="1" top="1" bottom="1" excludeFrom="down" topLeftRadiusX="10" topLeftRadiusY="10" bottomLeftRadiusX="10" bottomLeftRadiusY="10" topRightRadiusX="10" topRightRadiusY="10" bottomRightRadiusX="10" bottomRightRadiusY="10"&gt; &lt;s:stroke&gt; &lt;s:SolidColorStroke color="0xffffff" color.over="#40608f" alpha="0.3" weight="0" weight.over="1" alpha.over="0.7"&gt; &lt;/s:SolidColorStroke&gt; &lt;!--&lt;s:LinearGradientStroke rotation="90" weight="1"&gt; &lt;s:GradientEntry color="0x57626f" alpha="0.22" alpha.over="0.22" /&gt; &lt;s:GradientEntry color="0x586678" alpha.over="0.22" /&gt; &lt;/s:LinearGradientStroke&gt;--&gt; &lt;/s:stroke&gt; &lt;/s:Rect&gt; &lt;!-- layer 6: highlight stroke (down state only) --&gt; &lt;!--- @private --&gt; &lt;s:Rect id="hldownstroke1" left="1" right="1" top="1" bottom="1" topLeftRadiusX="10" topLeftRadiusY="10" bottomLeftRadiusX="10" bottomLeftRadiusY="10" includeIn="down"&gt; &lt;s:stroke&gt; &lt;s:LinearGradientStroke rotation="90" weight="1"&gt; &lt;s:GradientEntry color="0x000000" alpha="0.25" ratio="0.0" /&gt; &lt;s:GradientEntry color="0x000000" alpha="0.25" ratio="0.001" /&gt; &lt;s:GradientEntry color="0x000000" alpha="0.07" ratio="0.0011" /&gt; &lt;s:GradientEntry color="0x000000" alpha="0.07" ratio="0.965" /&gt; &lt;s:GradientEntry color="0x000000" alpha="0.00" ratio="0.9651" /&gt; &lt;/s:LinearGradientStroke&gt; &lt;/s:stroke&gt; &lt;/s:Rect&gt; &lt;!--- @private --&gt; &lt;s:Rect id="hldownstroke2" left="2" right="2" top="2" bottom="2" topLeftRadiusX="10" topLeftRadiusY="10" bottomLeftRadiusX="10" bottomLeftRadiusY="10" includeIn="down"&gt; &lt;s:stroke&gt; &lt;s:SolidColorStroke color="0x2c2c2c" alpha=".56" weight="0.1"&gt; &lt;/s:SolidColorStroke&gt; &lt;!--&lt;s:LinearGradientStroke rotation="90" weight="1"&gt; &lt;s:GradientEntry color="0x000000" alpha="0.09" ratio="0.0" /&gt; &lt;s:GradientEntry color="0x000000" alpha="0.00" ratio="0.0001" /&gt; &lt;/s:LinearGradientStroke&gt;--&gt; &lt;/s:stroke&gt; &lt;/s:Rect&gt; &lt;!-- layer 7: border - put on top of the fill so it doesn't disappear when scale is less than 1 --&gt; &lt;!--- @private --&gt; &lt;s:Rect id="border" left="0" right="0" top="0" bottom="0" width="69" height="20" topLeftRadiusX="10" topLeftRadiusY="10" bottomLeftRadiusX="10" bottomLeftRadiusY="10"&gt; &lt;/s:Rect&gt; &lt;!-- layer 8: text --&gt; &lt;!--- @copy spark.components.supportClasses.ButtonBase#labelDisplay --&gt; &lt;s:Label id="labelDisplay" textAlign="center" maxDisplayedLines="1" color="0x3d6295" fontWeight="bold" horizontalCenter="0" verticalCenter="1" verticalAlign="middle" left="10" right="10" top="2" bottom="2"&gt; &lt;/s:Label&gt; &lt;/s:SparkButtonSkin&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload