actionscript-3 - 弹性 : Purepdf : Aligning paragraph text into the middle of a SimpleCell?

标签 actionscript-3 apache-flex flex4.5

我尝试了这段代码,但由于某种原因它不起作用..

var table : SimpleTable     = new SimpleTable();
    table.widthPercentage   = 100;
    table.borderWidth       = 1;

var row : SimpleCell        = new SimpleCell( SimpleCell.ROW );
    row.border              = 1;
    row.borderColor         = RGBColor.fromARGB( 0x555555 );
    row.borderWidth         = 1;
    row.verticalAlignment   = Element.ALIGN_MIDDLE;

var cell1 : SimpleCell      = new SimpleCell( SimpleCell.CELL );
    cell1.widthpercentage   = 25;
    cell1.verticalAlignment = Element.ALIGN_MIDDLE;

var p : Paragraph = new Paragraph( 'test', PurePDFGenerator.pdf.cyrillicFont );
    p.alignment = Element.ALIGN_MIDDLE;

cell1.add( p );


row.add( cell1 );
table.add( row );
  • 如何将段落文本对齐到简单单元格的中间?

最佳答案

在 Paragraph.alignment 起作用之前,您可以使用

cell.horizontalAlignment = Element.ALIGN_CENTER;

关于actionscript-3 - 弹性 : Purepdf : Aligning paragraph text into the middle of a SimpleCell?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9774956/

相关文章:

actionscript-3 - 如何在 Android/Black berry 的 Air 中打开 pdf

actionscript-3 - AS3 : Are events inefficient?

apache-flex - Flex Web App 自动化测试

eclipse - 连接Eclipse IDE以运行Flex 4.5.1 SDK时出错

apache-flex - Flex 程序翻译中的复数形式

css - 组件状态的 Adob​​e Flex 设置样式

macos - as3 scanHardware()函数使我的应用程序崩溃

Flash/Actionscript 3 位图裁剪,带有羽化边缘(模糊边缘)

android - Flex 移动警报 - 本地通知

apache-flex - Adobe Native Extensions - 不工作?