我想更改 flex 4.5 移动应用程序中火花按钮组件的字体位置。目前 flex 默认在按钮中间显示字体。但我想将字体位置更改为其他位置。我尝试覆盖覆盖方法layoutContents。但我得到了两种字体。谁能帮我。
<s:Button label="Test TestGreenGo" skinClass="skins.RoundedButtonSkin"/>
这是我的 RoundedButtonSkin 类
package skins
{
import spark.skins.mobile.ButtonSkin;
public class RoundedButtonSkin extends ButtonSkin
{
private var colorized:Boolean = false;
public function RoundedButtonSkin()
{
super();
measuredDefaultHeight = 44;
measuredDefaultWidth = 220;
}
override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
{
super.layoutContents(unscaledWidth, unscaledHeight);
setElementPosition(upBorderSkin, 0, 0);
setElementSize(upBorderSkin, unscaledWidth, unscaledHeight);
setElementPosition(labelDisplay,0,0);
invalidateDisplayList();
validateNow();
}
}
}