Warning: CSS type selectors are not supported in components 'sparks.component.TextInput'

爷,独闯天下 提交于 2019-12-19 02:01:51

问题


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>

回答1:


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


来源:https://stackoverflow.com/questions/3125364/warning-css-type-selectors-are-not-supported-in-components-sparks-component-te

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!