【发布时间】:2015-07-25 23:14:45
【问题描述】:
我有一个 TextArea 锚定在 AnchorPane 的顶部、左侧和右侧。每当窗口被调整为更小(即调整 AnchorPane 和 TextArea 的大小)时,滚动条将显示在 TextArea 上,即使文本甚至没有接近填满整个区域。
行为不一致,有时它会显示两个滚动条,有时只是水平的,有时不显示。您可以通过增大窗口来使滚动条消失。
这是 TextArea 的 FXML:
<TextArea fx:id="teamDescription" layoutX="10.0" layoutY="107.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" onKeyPressed="#handleTextAreaKeyPress" prefHeight="42.0" prefWidth="380.0">
<VBox.margin>
<Insets bottom="10.0" />
</VBox.margin>
</TextArea>
这是 JavaFX 的问题吗?因为我想不出我做错了什么。
【问题讨论】: