如何在JavaFX中的Accordion中的TitledPanes之间添加填充 [英] How to add padding between TitledPanes in an Accordion in JavaFX
问题描述
我想在手风琴
(中的间距)
)。 TitledPane
手风琴
问题是,当扩展 TitledPane
TitledPane
未展开
一个 TittedPane
展开
我使用了以下CSS:
.titled-pane {
-fx-skin:com.sun.javafx.scene.control.skin.TitledPaneSkin;
-fx-text-fill:-fx-text-base-color;
-fx-padding:0.5em;
}
一张图片显示了2 TitledPane
未展开,另一个图像显示第二个
TitledPane
后的感觉。
这是一个错误(我创建了一个错误报告:
I would like to add padding between TitledPane
s in an Accordion
(spacing in Accordion
).
The problem is that, when a TitledPane
is expanded, the look and feel of the next TitledPane
is broken.
TitledPane
s unexpanded
One TitledPane
expanded
I have used the following CSS:
.titled-pane {
-fx-skin: "com.sun.javafx.scene.control.skin.TitledPaneSkin";
-fx-text-fill: -fx-text-base-color;
-fx-padding: 0.5em;
}
One image show the separation between 2 TitledPane
s unexpanded, and another image show the look an feel of the second TitledPane
after open the first one.
It's a bug (I've created a bug report: JDK-8162599).
As a workaround, if you specify only the bottom padding of TitledPane
s (rather than the top), the spacing between TitledPane
s 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:
这篇关于如何在JavaFX中的Accordion中的TitledPanes之间添加填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!