【发布时间】:2011-12-11 06:59:39
【问题描述】:
我正在尝试将一些内容垂直居中放置在 bounding_box 中。使用单个文本没问题:
bounding_box([0, bounds.top], :width => pdf.bounds.right, :height => pdf.bounds.top) do
text "vertically aligned in the surrounding box", :valign => :center
end
但是如果我的边界框中有多个元素,我该怎么办:
bounding_box([0, bounds.top], :width => pdf.bounds.right, :height => pdf.bounds.top) do
text "vertically aligned in the surrounding box", :valign => :center
text "vertically aligned in the surrounding box", :valign => :center
end
那不行,当你尝试这个时,文本被覆盖了......
我正在寻找一种方法来对 bounding_box 的全部内容进行分组,然后垂直对齐整个组。有没有办法用大虾做到这一点??
非常感谢您的帮助! 克里斯
【问题讨论】:
标签: ruby alignment prawn bounding-box valign