How to add padding between TitledPanes in an Accordion in JavaFX

前端 未结 1 596
清歌不尽
清歌不尽 2021-01-21 14:11

I would like to add padding between TitledPanes in an Accordion (spacing in Accordion).

The problem is that, when a TitledPa

相关标签:
1条回答
  • 2021-01-21 14:40

    It's a bug (I've created a bug report: JDK-8162599).

    As a workaround, if you specify only the bottom padding of TitledPanes (rather than the top), the spacing between TitledPanes in the Accordion is correct.

    CSS to add bottom padding

    .accordion > .titled-pane {
        -fx-padding: 0 0 0.5em 0;
    }
    

    An example Accordion looks like this:

    0 讨论(0)
提交回复
热议问题