Apache flex 过滤器是否会破坏Flex4.5皮肤中的ColorizeExclusion,如果是,是否有解决方法?
我在Flex 4.5中创建了一个MXML spark按钮外观,它似乎工作得非常出色,只是在关闭状态下,它忽略了我的colorizeExclusions数组,该数组当前正在保护按钮上的文本标签和突出显示。“向上”状态和“向下”状态之间的唯一区别是,我在“向下”状态中应用了内部阴影 StackOverflow不允许我发布图像,因为我是新用户,所以我在其他地方发布了一些图像: 在第二张图片中,查看高亮显示和文本如何用蓝色着色?那完全是错误的 如果我没有对这个内部阴影设置状态限制,我会看到相同的问题:我的colorizeExclusions被忽略,因此它似乎与状态无关,或者与任何特定于状态的CSS无关,在本例中,无论如何都没有 以下是按钮外观代码:Apache flex 过滤器是否会破坏Flex4.5皮肤中的ColorizeExclusion,如果是,是否有解决方法?,apache-flex,filter,skinning,flex-spark,dropshadow,Apache Flex,Filter,Skinning,Flex Spark,Dropshadow,我在Flex 4.5中创建了一个MXML spark按钮外观,它似乎工作得非常出色,只是在关闭状态下,它忽略了我的colorizeExclusions数组,该数组当前正在保护按钮上的文本标签和突出显示。“向上”状态和“向下”状态之间的唯一区别是,我在“向下”状态中应用了内部阴影 StackOverflow不允许我发布图像,因为我是新用户,所以我在其他地方发布了一些图像: 在第二张图片中,查看高亮显示和文本如何用蓝色着色?那完全是错误的 如果我没有对这个内部阴影设置状态限制,我会看到相同的问题:我
<?xml version="1.0" encoding="utf-8"?>
<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"
xmlns:fxg="assets.fxg.*"
minWidth="18" minHeight="18"
alpha.disabled="0.5">
<fx:Metadata>
<![CDATA[
/**
* @copy spark.skins.spark.ApplicationSkin#hostComponent
*/
[HostComponent("spark.components.Button")]
]]>
</fx:Metadata>
<fx:Script fb:purpose="styling">
<![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", "highlight"];
/**
* @private
*/
override public function get colorizeExclusions():Array {return exclusions;}
/**
* @private
*/
override protected function initializationComplete():void
{
useChromeColor = true;
super.initializationComplete();
}
]]>
</fx:Script>
<!-- states -->
<s:states>
<s:State name="up" />
<s:State name="over" />
<s:State name="down" />
<s:State name="disabled" />
</s:states>
<s:Group left="0" right="0" top="0" bottom="0">
<!-- Background -->
<s:Group id="background" left="0" right="0" top="0" bottom="0">
<fxg:GlassButtonBack excludeFrom="over" left="0" right="0" top="0" bottom="0"/>
<fxg:GlassButtonBackBright includeIn="over" left="0" right="0" top="0" bottom="0"/>
</s:Group>
<!-- layer 8: text -->
<!--- @copy spark.components.supportClasses.ButtonBase#labelDisplay -->
<s:Label id="labelDisplay" left="16" right="16" top="8" bottom="8"
fontWeight="bold" horizontalCenter="0" maxDisplayedLines="1" textAlign="center"
verticalAlign="middle" verticalCenter="1"/>
<s:Rect id="highlight" left="3" right="3" top="3" height="40%" radiusX="6" radiusY="6">
<s:fill>
<s:LinearGradient rotation="90">
<s:entries>
<s:GradientEntry ratio="0" alpha="0.9" color="#FFFFFF" />
<s:GradientEntry ratio="1" alpha="0" color="#FFFFFF" />
</s:entries>
</s:LinearGradient>
</s:fill>
</s:Rect>
<s:filters>
<s:DropShadowFilter includeIn="down" inner="true" color="#000000" blurX="10" blurY="10" angle="90"/>
</s:filters>
</s:Group>
有人知道这里到底发生了什么吗?这是Flex bug吗?有解决办法吗?我做了什么蠢事吗?在这里,我真是不知所措。快速概述:
static private const exclusions:Array = ["labelDisplay", "highlight"];
我认为它不应该是静态的,试着移除它,看看会发生什么。在spark.skins.spark.ButtonSkin中它是静态的。此外,我尝试删除静态,只是为了见鬼,但它并没有解决问题。问题是在您的背景区域。删除/注释该部分,问题就会在我可以测试的范围内消失。你能把fxp贴出来吗?内特,当我对那个区域发表评论时,恐怕这并没有解决问题。因此,这似乎与我的fxgs无关。