在我的 Flex 应用程序中,我使用 Main.mxml
sub.mxml
在Sub.mxml中有代码。
<mx:Label x="24" y="33" text="User ID"/>
<mx:Label x="24" y="59" text="Password"/>
然后在我的 Main.Mxml 文件中编写 CSS
mx|Label{
fontFamily: Calibri;
fontSize: 12;
color: #000000;
}
但是 Label 不可见...这个 Css 是不是错了?
最佳答案
代码看起来没问题。这个简单的例子有效:
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Script>
<![CDATA[ import mx.events.FlexEvent; ]]>
</fx:Script>
<fx:Style>
@namespace mx "library://ns.adobe.com/flex/mx";
mx|Label {
fontFamily: Calibri;
fontSize: 12;
color: #000000;
}
</fx:Style>
<mx:VBox>
<mx:Label text="asdasdasd">
</mx:Label>
<mx:Label text="sdas">
</mx:Label>
</mx:VBox>
</s:Application>
大卫
关于css - 如何使用 CSS 更改 flex 中的标签颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14723560/