2

右の TiteldPane の垂直サイズに問題があります (下の図を参照)。両方の TitledPanes が GridPane に配置されます。小さい方が左と同じ高さになるようにしたいです。Vgrow を右の TitledPane の「常に」に設定しようとしましたが、何も起こりませんでした。また、地域で何かをしようとしましたが、成功しませんでした。絶対的な高さを与えずにこれは可能ですか?

事前にご協力いただきありがとうございます。

ここに画像の説明を入力

<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.control.TitledPane?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.RowConstraints?>

<AnchorPane xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1">
   <children>
      <ScrollPane AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
        <content>
          <AnchorPane>
               <children>
                  <GridPane hgap="20.0" vgap="20.0">
                    <columnConstraints>
                      <ColumnConstraints hgrow="SOMETIMES" />
                      <ColumnConstraints hgrow="SOMETIMES" />
                    </columnConstraints>
                    <rowConstraints>
                      <RowConstraints valignment="TOP" vgrow="ALWAYS" />
                    </rowConstraints>
                     <padding>
                        <Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
                     </padding>
                     <children>
                        <TitledPane animated="false" text="TitledPane">
                           <content>
                              <GridPane hgap="10.0" vgap="5.0">
                                <columnConstraints>
                                  <ColumnConstraints hgrow="SOMETIMES" minWidth="100.0" />
                                  <ColumnConstraints hgrow="SOMETIMES" minWidth="100.0" />
                                </columnConstraints>
                                <rowConstraints>
                                  <RowConstraints vgrow="SOMETIMES" />
                                  <RowConstraints vgrow="SOMETIMES" />
                                  <RowConstraints vgrow="SOMETIMES" />
                                    <RowConstraints vgrow="SOMETIMES" />
                                    <RowConstraints vgrow="SOMETIMES" />
                                    <RowConstraints vgrow="SOMETIMES" />
                                    <RowConstraints vgrow="SOMETIMES" />
                                </rowConstraints>
                                 <children>
                                    <Label text="Label" GridPane.halignment="RIGHT" />
                                    <Label GridPane.columnIndex="1" GridPane.rowIndex="1" />
                                    <Label text="Label" GridPane.halignment="RIGHT" GridPane.rowIndex="2" />
                                    <Label GridPane.columnIndex="1" GridPane.rowIndex="3" />
                                    <Label text="Label" GridPane.halignment="RIGHT" GridPane.rowIndex="4" />
                                    <Label GridPane.columnIndex="1" GridPane.rowIndex="5" />
                                    <TextField GridPane.columnIndex="1" />
                                    <TextField GridPane.columnIndex="1" GridPane.rowIndex="2" />
                                    <TextField fx:id="abgar10TF" GridPane.columnIndex="1" GridPane.rowIndex="4" />
                                 </children>
                              </GridPane>
                           </content>
                        </TitledPane>
                        <TitledPane animated="false" text="TitledPane" GridPane.columnIndex="1" GridPane.valignment="TOP" GridPane.vgrow="ALWAYS">
                           <content>
                              <GridPane hgap="10.0" vgap="5.0">
                                <columnConstraints>
                                  <ColumnConstraints hgrow="SOMETIMES" minWidth="100.0" />
                                  <ColumnConstraints hgrow="SOMETIMES" minWidth="100.0" />
                                </columnConstraints>
                                <rowConstraints>
                                  <RowConstraints vgrow="SOMETIMES" />
                                  <RowConstraints vgrow="SOMETIMES" />
                                  <RowConstraints vgrow="SOMETIMES" />
                                    <RowConstraints vgrow="SOMETIMES" />
                                </rowConstraints>
                                 <children>
                                    <Label text="Label" GridPane.halignment="RIGHT" />
                                    <Label GridPane.columnIndex="1" GridPane.rowIndex="1" />
                                    <Label text="Label" GridPane.halignment="RIGHT" GridPane.rowIndex="2" />
                                    <Label GridPane.columnIndex="1" GridPane.rowIndex="3" />
                                    <TextField GridPane.columnIndex="1" />
                                    <TextField GridPane.columnIndex="1" GridPane.rowIndex="2" />
                                 </children>
                              </GridPane>
                           </content>
                        </TitledPane>
                     </children>
                  </GridPane>
               </children>
            </AnchorPane>
        </content>
      </ScrollPane>
   </children>
</AnchorPane>
4

1 に答える 1

2

両方の TitlePanes の最大高さをMAX_VALUE

于 2016-03-25T22:13:51.227 に答える