警告:组件的sparks.component.TextInput中不支持CSS类型选择器 [英] Warning: CSS type selectors are not supported in components 'sparks.component.TextInput'

查看:202
本文介绍了警告:组件的sparks.component.TextInput中不支持CSS类型选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做一个简单的CSS声明。但是,我有上面的警告,不知道如何解决它。我认为s(type)应该为我声明样式。

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>


推荐答案

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

CSS Type selectors are not allowed inside a component definition.

您有两个选项:


  • 使用类别选择器

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

这篇关于警告:组件的sparks.component.TextInput中不支持CSS类型选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆