警告:组件“sparks.component.TextInput"不支持 CSS 类型选择器 [英] Warning: CSS type selectors are not supported in components 'sparks.component.TextInput'
本文介绍了警告:组件“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屋!
查看全文