Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
警告:组件';中不支持CSS类型选择器;sparks.component.TextInput';_Css_Apache Flex_Types_Flex Spark - Fatal编程技术网

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

警告:组件';中不支持CSS类型选择器;sparks.component.TextInput';,css,apache-flex,types,flex-spark,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; }

我试图做一个简单的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>

@命名空间s“library://ns.adobe.com/flex/spark";
@名称空间mx“library://ns.adobe.com/flex/mx";
s |文本输入{
颜色:#313131;
}           

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

您有两个选择:

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

老兄……没有一本书提到过这一点!他们只说类型选择器有多棒,但从来没有提到它在组件中不受支持。我一直在寻找答案。我想我会听从你的建议。谢谢