Combox的样式修改

import flash.text.TextFormat;

// combox 是一个ComboBox组件(Component)
// 设置它的宽度和高度
combox.width = 300 ;
combox.height = 48 ;
// 添加几个选项
combox.addItem( { data : 1 ,label: '测试项目一' } ) ;
combox.addItem( { data : 2 ,label: '测试项目二' } ) ;
combox.addItem( { data : 3 ,label: '测试项目三' } ) ;
// 建立一个TextFormat实例
var tft: TextFormat = new TextFormat ( ) ;
// 设置其字体大小为32
tft.size = 32 ;

var tft2:TextFormat=new TextFormat();
tft2.size=18;
// 设置其字体为微软雅黑
// 建议大家使用相应的英文名字
tft.font = "宋体" ;
// 设置ComboBox的样式
combox.textField.setStyle('textFormat',tft);
// 设置下拉选项的样式
combox.dropdown.setRendererStyle( "textFormat" , tft2) ;
// 设置下拉选项的行高
combox.dropdown.rowHeight = 48 ;
// 设置下拉选项的宽度
// 可以和ComboBox不一样哦
combox.dropdownWidth = 360 ;

原文地址:https://www.cnblogs.com/naiking/p/2251637.html