我将一些内容放入ScrollPane中,因为如果内容不能适应屏幕,我希望有一个水平滚动条。
只要不需要滚动条,一切都很好:
但是,当滚动条显示时,它(垂直地)隐藏了部分内容:
如何防止这种行为?内容应始终完全显示。我尝试使用fitToHeight="true",但没有帮助。
以下是一些FXML示例(添加了多个HBox和VBox层,以模仿我的真实应用程序结构):
只要不需要滚动条,一切都很好:
但是,当滚动条显示时,它(垂直地)隐藏了部分内容:
如何防止这种行为?内容应始终完全显示。我尝试使用fitToHeight="true",但没有帮助。
以下是一些FXML示例(添加了多个HBox和VBox层,以模仿我的真实应用程序结构):
<BorderPane>
<top>
<ScrollPane vbarPolicy="NEVER" fitToHeight="true">
<HBox>
<VBox>
<TitledPane text="Title">
<HBox spacing="100.0">
<Text text="Test1 Test2 Test3 Test4"></Text>
<Text text="Test1 Test2 Test3 Test4"></Text>
<Text text="Test1 Test2 Test3 Test4"></Text>
<Text text="Test1 Test2 Test3 Test4"></Text>
<Text text="Test1 Test2 Test3 Test4"></Text>
<Text text="Test1 Test2 Test3 Test4"></Text>
<Text text="Test1 Test2 Test3 Test4"></Text>
<Text text="Test1 Test2 Test3 Test4"></Text>
<Text text="Test1 Test2 Test3 Test4"></Text>
<Text text="Test1 Test2 Test3 Test4"></Text>
<Text text="Test1 Test2 Test3 Test4"></Text>
</HBox>
</TitledPane>
</VBox>
</HBox>
</ScrollPane>
</top>
<center>
</center>
<bottom>
</bottom>
</BorderPane>
FXML
。 - SedJ601