我正在开发一个 AIR 应用程序,我需要更改下拉列表中显示的文本以及组合框上的主要文本的字体大小。我的 ComboBox 很大,但里面显示的文字很小。我尝试通过将 TextFormat 传递给 setStyle 方法,例如:
cmbEmployee.setStyle("textFormat", txtform);
但它没有用。尽管相同的方法适用于 TextField。
有人可以帮忙吗?
最佳答案
ComboBox
是一个包含 textField
的容器和一个 dropdown
成分。您需要将“样式”应用于 ComboBox 内的特定组件:
// Text Formats that needs to be applied on your comboBox
var txtformat:TextFormat = new TextFormat();
txtformat.size = 30; // Lets just increase the size of fonts
// Increase the main TextField's font size of your ComboBox
yourComboBox.textField.setStyle("textFormat", txtformat);
// Increase the font size to the dropdown component
yourComboBox.dropdown.setRendererStyle("textFormat", txtformat);
关于actionscript-3 - 通过 AS3 设置组合框文本格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16311141/