adobe flash builder 4:组件 Spark.components.Label 不支持 css 类型选择器

发布于 2024-09-07 09:48:48 字数 831 浏览 1 评论 0原文

可能的重复:
警告:不支持 css 类型选择器在组件'sparks.component.TextInput'中

我创建了一个新的 MXML 组件,其中包含一些标签和以下样式:

<fx:Style>
    @namespace s "library://ns.adobe.com/flex/spark";
    @namespace mx "library://ns.adobe.com/flex/mx";
    @namespace local "*";
    s|Label {
        font-size:12;
        font-weight:bold;
        color:white;
    }
    #timeLeftHGroup {
        left:30;
        top:12;
    }

我在 s|Label 行收到以下警告:

CSS type selectors are not supported in components: 'spark.components.Label'    

嗯.. CSS 代码确实有效!它确实改变了颜色,使文本加粗并将字体大小更改为 12,那么为什么我会收到此警告?

Possible Duplicate:
Warning: css type selectors are not supported in components ‘sparks.component.TextInput’

I created a new MXML component that contains some labels and the following style:

<fx:Style>
    @namespace s "library://ns.adobe.com/flex/spark";
    @namespace mx "library://ns.adobe.com/flex/mx";
    @namespace local "*";
    s|Label {
        font-size:12;
        font-weight:bold;
        color:white;
    }
    #timeLeftHGroup {
        left:30;
        top:12;
    }

I get the following warning at the s|Label line:

CSS type selectors are not supported in components: 'spark.components.Label'    

Well.. the CSS code does work! it did change the color, make the text bold and changed the font size to 12, so why do i get this warning ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

醉城メ夜风 2024-09-14 09:48:48

s|被忽略,因为在组件内部使用时不支持它。尝试将其放入应用于整个应用程序的根级样式表中。

s| is ignored as it's not supported when used inside of a component. Try putting it in a root level style sheet which is applied to the entire application.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文