醒着☆☆

H5 Laya Native Game

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: :: 管理 ::

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 ;

posted on 2011-11-16 19:33  醒着/☆☆  阅读(903)  评论(0编辑  收藏  举报