我希望能够使用我的 CSS 文件中定义的样式来设置 TextFlow 元素的样式。我当前的 TextFlow 实现如下所示,但对我的样式的更改似乎没有生效。如何在 Flex 4.5.1 中使用 CSS 样式设置 TextFlow 样式?
// In defaults.css
.textHeader
{
fontFamily: "Trebuchet MS";
fontWeight: normal;
fontStyle: normal;
fontSize: 25;
color: #FF0000;
}
.textBody
{
fontFamily: "Trebuchet MS";
fontWeight: normal;
fontStyle: normal;
fontSize: 12;
color: #525252;
}
// In MySkin.mxml
<s:RichText left="5" right="5" top="5" bottom="5" id="richText">
<s:textFlow>
<s:TextFlow>
<s:p styleName="textHeader">
Cupcake cookie cotton candy chupa chups biscuit marzipan.
</s:p>
<s:p styleName="textBody">
Cupcake cookie cotton candy chupa chups biscuit marzipan.
Jelly beans cake jujubes. Powder cotton candy apple pie applicake.
Bear claw powder dessert macaroon.
</s:p>
</s:TextFlow>
</s:textFlow>
</s:RichText>