• DataGrid 表头标题,表格文字的字体设置


    主文件中导入包:

    import fl.controls.listClasses.CellRenderer;
    import fl.data.DataProvider;
    import fl.controls.dataGridClasses.DataGridColumn;
    
    DG.setStyle("headerRenderer", DatagridHeaderStyle);
    DG.setStyle("cellRenderer", DatagridCellStyle);
    

     DatagridHeaderStyle.as

    package {
    	
     import fl.controls.dataGridClasses.HeaderRenderer;
     import flash.text.TextFormat;
    
     public class DatagridHeaderStyle extends HeaderRenderer {
    
      public function DatagridHeaderStyle():void {
       super();
      }
    
     override protected function drawBackground():void {
       var format:TextFormat = new TextFormat();
       format.font = "Arial";//字体为宋体
       format.bold = true;//加粗
       format.size = 12;//大小为12
       format.color = 0x333333;//颜色
       setStyle("textFormat",format);
       super.drawBackground();
      }
     }
    }
    

     DatagridCellStyle.as

    package {
     import fl.controls.listClasses.CellRenderer;
     import fl.controls.listClasses.ICellRenderer;
     import flash.text.TextFormat;
    
     public class DatagridCellStyle extends CellRenderer implements ICellRenderer {
    
      public function DatagridCellStyle():void {
       super();
      }
    
      override protected function drawBackground():void {
       var format:TextFormat = new TextFormat();
       format.font = "Arial";
       format.size = 12;
       format.color = 0x333333;
       setStyle("textFormat",format);
       super.drawBackground();
      }
     }
    }
    
    
  • 相关阅读:
    hdu 4334 Trouble
    hdu 4324 Triangle LOVE
    hdu 4255 A Famous Grid
    hdu 3549 Flow Problem
    hdu 3371 Connect the Cities
    hdu 2846 Repository
    hdu 2120 Ice_cream's world I
    P3304 [SDOI2013]直径(【模板】树直径的必经边)
    P5490 【模板】扫描线
    P1364 医院设置(【模板】树的重心)
  • 原文地址:https://www.cnblogs.com/wqing/p/2388414.html
Copyright © 2020-2023  润新知