【问题标题】:Want the height of ControlsFX SpreadsheetView to the total of the rowheight想要 ControlsFX SpreadsheetView 的高度为 rowheight 的总和
【发布时间】:2016-09-19 09:16:56
【问题描述】:

我希望电子表格视图的高度与其中的总行数一样长。 也就是说,如果有 3 行高度为 30、40、50,则电子表格视图的高度应为 120,我希望 rowheight 为 AUTOFIT,因为我将文本包装在几个单元格上。 getRowHeight 返回 AUTOFIT,但我想要单元格或行的实际高度,因为该行与最高单元格一样高。

【问题讨论】:

    标签: javafx-8 controlsfx


    【解决方案1】:

    Grid 上的 getRowHeight 确实会返回 AUTOFIT,因为网格是模型,也是预期的。

    但如果您确实在 SpreadsheetView 本身上调用 getRowHeight(必须创建皮肤),您将按要求获得行高:

     for(int i=0;i<spreadSheetView.getGrid().getRowCount(); i++){
                        System.out.println(spreadSheetView.getRowHeight(i));
                    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-02-22
      • 1970-01-01
      • 2013-06-28
      • 1970-01-01
      • 1970-01-01
      • 2011-03-25
      • 1970-01-01
      相关资源
      最近更新 更多