我试图在表单项中取消加粗标签。如您所见,标签以编程方式对颜色更改做出反应,但不受对fontWeight属性的更改的影响。有没有人有建议?
谢谢。
<?xml version="1.0" encoding="utf-8"?>
<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">
<fx:Style>
@namespace mx "library://ns.adobe.com/flex/mx";
@namespace s "library://ns.adobe.com/flex/spark";
global {
font-family: Verdana;
fontWeight: normal;
}
s|Label#labelDisplay {
color: red;
fontWeight:normal;
}
</fx:Style>
<s:Form>
<s:FormItem label="Please enter a string:" fontWeight="normal">
<s:TextInput/>
</s:FormItem>
</s:Form>
</s:Application>
答案 0 :(得分:0)
尝试直接在FormItem的labelDisplay外观部件上设置fontWeight样式。您可能必须在ActionScript中执行此操作。尝试这样的事情:
<s:FormItem id="stringLabel" label="Please enter a string:" creationComplete="{stringLabel.labelDisplay.setStyle('fontWeight','normal'}" >
因为FormItem只是一个SkinnableContainer; fontWeight没有任何影响我并不感到惊讶;然而令人沮丧的是,这种风格没有传递给标签儿童。