【发布时间】:2011-04-25 13:09:12
【问题描述】:
到底如何在按钮栏的按钮中放置一个简单的 CSS 渐变? 我一直在到处寻找,我对蒙皮一点也不感兴趣,让所有脏代码只有一个简单的渐变似乎很奇怪。
这是我的css
.my_ButtonBar{
buttonStyleName: "buttonBarButton";
firstButtonStyleName: "firstButtonBarButton";
lastButtonStyleName: "lastButtonBarButton";
}
.buttonBarButton
{
fillColors: red, red;
}
这是我的 mxml
<s:ButtonBar dataProvider="{viewstack}" width="200" top="0" left="0" styleName="main_ButtonBar">
<s:layout>
<s:TileLayout columnWidth="200" rowHeight="50"
horizontalGap="-1" verticalGap="-1" />
</s:layout>
</s:ButtonBar>
在 user700284 的响应之后,我基于按钮栏类创建了一个新的皮肤类。
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
alpha.disabled="0.5">
<fx:Metadata>
<![CDATA[
/**
* @copy spark.skins.spark.ApplicationSkin#hostComponent
*/
[HostComponent("spark.components.ButtonBar")]
]]>
</fx:Metadata>
<s:states>
<s:State name="normal" />
<s:State name="disabled" />
</s:states>
<fx:Declarations>
<fx:Component id="firstButton">
<s:ButtonBarButton skinClass="spark.skins.spark.ButtonBarFirstButtonSkin" />
</fx:Component>
<fx:Component id="middleButton" >
<s:ButtonBarButton skinClass="spark.skins.spark.ButtonBarMiddleButtonSkin" />
</fx:Component>
<fx:Component id="lastButton" >
<s:ButtonBarButton skinClass="spark.skins.spark.ButtonBarLastButtonSkin" />
</fx:Component>
</fx:Declarations>
<s:DataGroup id="dataGroup" width="100%" height="100%">
<s:layout>
<s:TileLayout columnWidth="200" rowHeight="50"
horizontalGap="-1" verticalGap="-1" />
</s:layout>
</s:DataGroup>
</s:Skin>
如果我添加一个矩形填充,它将填充整个按钮栏,而不是单独填充每个按钮。我怎样才能在按钮上放一个简单的渐变??????
【问题讨论】:
标签: apache-flex coding-style gradient