我已经在Flash Builder 4中使用Flex 4创建了一个示例桌面应用程序,其中我正在使用BorderContainer中的按钮。 我已经应用了皮肤按钮,其中包括下拉阴影,发光滤镜,斜角滤镜和渐变颜色。滤镜和渐变颜色不能同时应用于按钮皮肤
但我面临一个问题,同时使用过滤器和渐变填充。 使用过滤器时,渐变填充不显示,反之亦然。 请让我知道我犯了什么错误。
这是main.mxml代码:
<s:BorderContainer backgroundColor="#003C7B" verticalCenter="0" horizontalCenter="0" height="350" width="450">
<s:Button id="btn" label="Select" color="white" verticalCenter="0" skinClass="BlueButtonSkin" horizontalCenter="0"/>
</s:BorderContainer>
过滤器和渐变填充皮肤类代码如下:本
<s:Rect id="backgroundAndShadow" left="0" right="0" top="0" bottom="0" radiusX="5" radiusY="5"
topLeftRadiusX="5" topLeftRadiusY="5" topRightRadiusX="5" topRightRadiusY="5"
bottomLeftRadiusX="5" bottomLeftRadiusY="5" bottomRightRadiusX="5" bottomRightRadiusY="5">
<s:fill>
<s:LinearGradient rotation="90">
<s:GradientEntry color="#00366E"/>
<s:GradientEntry color="#013A8B" />
</s:LinearGradient>
</s:fill>
<s:filters>
<s:GlowFilter alpha="0.9" color="#ffffff" inner="false" knockout="true" blurX="8" blurY="8" />
<s:BevelFilter angle="270" distance="5" />
</s:filters>
</s:Rect>
<s:RectangularDropShadow id="dropShadow" blurX="8" blurY="8" alpha="0.5" distance="5" tlRadius="5" trRadius="5" blRadius="5" brRadius="5"
angle="45" color="#000000" left="2" top="0" right="0" bottom="0"/>
<s:Rect id="border" left="0" right="0" top="0" bottom="0" width="75" height="15"
topLeftRadiusX="5" topLeftRadiusY="5" topRightRadiusX="5" topRightRadiusY="5"
bottomLeftRadiusX="5" bottomLeftRadiusY="5" bottomRightRadiusX="5" bottomRightRadiusY="5">
<s:stroke>
<s:SolidColorStroke joints="bevel" caps="round" color="#84C2F2" weight="0.3" alpha="0.3"/>
</s:stroke>
</s:Rect>
<s:Label id="labelDisplay"
textAlign="center"
verticalAlign="middle"
maxDisplayedLines="2"
horizontalCenter="0" verticalCenter="0"
left="10" right="10" top="2" bottom="2">
</s:Label>
有什么建议?
我附上了按钮所需的外观以供参考:
是的,渐变色出现,但所需的效果受到干扰,它并没有显示出我想要的样子。 – 2013-03-01 03:06:48
好吧,这完全是一个完全不同的问题:)我通常必须玩这样的事情一段时间才能最终发现令人满意的效果/设置组合。如果你仍然卡住,也许你可以尝试发布另一个问题,描述你所追求的效果(我确定我让它听起来比实际更容易)。 PS:我从来没有发现淘汰赛的财产是有用的。 – 2013-03-01 04:07:28
我同意你的Sunil.But如果我保持淘汰赛的属性,除了梯度填充部分,我需要的按钮外观才能实现。我唯一担心的是要同时管理这两者。 – 2013-03-01 04:47:45