警告:组件“sparks.component.TextInput”不支持 CSS 类型选择器

发布于 2024-09-07 16:53:14 字数 861 浏览 0 评论 0原文

我正在尝试做一个简单的 CSS 声明。但是,我收到了上面的警告,不知道如何解决。我认为 s|(type) 应该为我声明样式。

<fx:Style>
        @namespace s "library://ns.adobe.com/flex/spark";
        @namespace mx "library://ns.adobe.com/flex/mx";

        s|TextInput{
        color:#313131;
        }           
</fx:Style>

<s:Panel width="600" height="480" skinClass="skins.CustomPanel">
    <s:layout>
        <s:VerticalLayout paddingTop="7"/>
    </s:layout>
    <s:TextInput text="TextInput CSS not working"/>
    <mx:Form>
        <mx:FormHeading label="Please Enter The Information"/>
        <s:HGroup>
            <mx:FormItem>
                <s:Label text="Brand"/>
                <s:TextInput id="brand" text="CSS not working" width="156"/>
            </mx:FormItem>
    </mx:form>

I am trying to do a simple CSS declaration. However, I have got the warning above and not sure how to solve it. I thought s|(type) should declare the style for me.

<fx:Style>
        @namespace s "library://ns.adobe.com/flex/spark";
        @namespace mx "library://ns.adobe.com/flex/mx";

        s|TextInput{
        color:#313131;
        }           
</fx:Style>

<s:Panel width="600" height="480" skinClass="skins.CustomPanel">
    <s:layout>
        <s:VerticalLayout paddingTop="7"/>
    </s:layout>
    <s:TextInput text="TextInput CSS not working"/>
    <mx:Form>
        <mx:FormHeading label="Please Enter The Information"/>
        <s:HGroup>
            <mx:FormItem>
                <s:Label text="Brand"/>
                <s:TextInput id="brand" text="CSS not working" width="156"/>
            </mx:FormItem>
    </mx:form>

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

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

发布评论

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

评论(1

纸伞微斜 2024-09-14 16:53:26

组件定义中不允许使用 CSS 类型选择器。

您有两个选择:

  • 使用类选择器代替
  • 将类型选择器声明移动到在顶级 MXML 文件中声明的 css 中

CSS Type selectors are not allowed inside a component definition.

You have two options :

  • Use a class selector instead
  • Move the Type selector declaration in a css that is declared in your top MXML file
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文