flex - Spark 样式尚未工作 Spark 是当前主题
我试图找出为什么在使用 chromeColor (或其他 Spark 样式相关项目)时出现错误:
<s:Button x="10" y="208" label="CALL" width="185" fontWeight="bold" id="bCall" chromeColor="#F90000"/>
这是错误:
The style 'chromeColor' is only supported by type 'spark.components.Button' with the theme(s) 'spark'.
然而在项目 - 属性中,主题设置为 Spark。我还尝试将其设置为 Halo,然后再设置回 Spark。
这是我的应用程序定义:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="800" minHeight="600" width="100%" height="100%">
我看到将 mx 命名空间定义为“xmlns:mx=”library://ns.adobe.com/flex/halo”的参考资料,但随后我的 mx 组件中断了(例如 TabNavigator) - 不是确定这是否可以修复它。
我正在使用 flex 4.1 库(我相信该项目最初是在 flex builder 为 4.0 时创建的,如果这很重要的话)。 不包括其他库。 项目-属性设置为MX+Spark。
另外,如果我删除该 chromeColor,项目会编译,但会出现警告,例如:(
The style 'borderAlpha' is only supported by type 'spark.components.TitleWindow' with the theme(s) 'spark'. Flex Problem
以及其他 - borderColor、cornerRadius、dropShadowVisible)
I am trying to figure out why I am getting an error when using the chromeColor (or other spark style related items):
<s:Button x="10" y="208" label="CALL" width="185" fontWeight="bold" id="bCall" chromeColor="#F90000"/>
This is the error:
The style 'chromeColor' is only supported by type 'spark.components.Button' with the theme(s) 'spark'.
Yet in project - properties, the theme is set to Spark. I also tried setting it to Halo and then back to Spark.
Here is my app definition:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="800" minHeight="600" width="100%" height="100%">
I have seen references that define the mx namespace as "xmlns:mx="library://ns.adobe.com/flex/halo", but then my mx components break (TabNavigator for example) - not sure if that would fix it anway.
I is using flex 4.1 library (I believe the project was originally created when flex builder was at 4.0 if that matters).
No other libraries included.
Project - properties is set to MX+Spark.
Also, if I remove that chromeColor, the project compiles, BUT there are warnings such as:
The style 'borderAlpha' is only supported by type 'spark.components.TitleWindow' with the theme(s) 'spark'. Flex Problem
(and others - borderColor, cornerRadius, dropShadowVisible)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我终于找到了它 - 我有一个引用 mx/halo 的编译器标志集,我把它拿出来,现在工作正常。当我尝试在项目中使用一些与光环相关的代码时,我可能已经将其放入了。
I finally found it - I had a compiler flag set referencing mx/halo, I took that out and it works fine now. I may have put that in when I was trying to use some halo related code in the project.
我看到两个问题:
chromeColor 不是 记录
Button 类的样式。
borderAlpha 未记录在案titleWindow 类的样式。
当然,您看到的错误听起来确实具有误导性,但是是什么让您认为可以使用这些样式?
更改 titleWindow 中的边框 alpha 的“正确”方法是创建自定义外观。我认为 chromeColor 也是如此 [但对我来说这应该做什么并不明显]。
Two issues I see:
chromeColor is not a documented
style of the Button class.
borderAlpha is not a documented style of the titleWindow class.
The error you're seeing does sound misleading, for sure, but what makes you think you can use those styles?
The "proper" way to change the border alpha in the titleWindow would be to create a custom skin. I assume the same is true for chromeColor [but It is not obvious to me what that should do].