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

Fly*_*Cat 8 css apache-flex types flex-spark

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

<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>
Run Code Online (Sandbox Code Playgroud)

Flo*_*n F 25

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

您有两种选择:

  • 请改用类选择器
  • 将类型选择器声明移动到顶部MXML文件中声明的css中

  • 男人..没有书提到过!他们所说的只是伟大的类型选择器,但从未提及它在组件中不受支持.我有一段时间寻找答案.我想我会听从你的建议.谢谢! (2认同)