警告:CSSタイプセレクターはコンポーネントのsparks.component.textinput 'でサポートされていません

StackOverflow https://stackoverflow.com/questions/3125364

質問

私は簡単な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>
役に立ちましたか?

解決

CSSタイプセレクターは、コンポーネント定義内で許可されていません。

2つのオプションがあります。

  • 代わりにクラスセレクターを使用します
  • トップMXMLファイルで宣言されているCSSでタイプセレクター宣言を移動します
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top