我有以下fxml。在每个控制组之后我想要一些空间。怎么做到这一点?
<Label styleClass="field-view-label" text="%sections.right.section.model-editor.fieldName" />
<TextField fx:id="fieldName" styleClass="field-view-text" />
<Label styleClass="field-view-label" text="%sections.right.section.model-editor.fieldType" />
<ComboBox fx:id="fieldDataType" styleClass="field-view-combobox" />
<Label styleClass="field-view-label" text="Field Reference" />
<ComboBox fx:id="fieldReference" styleClass="field-view-combobox" />
<Label styleClass="field-view-label" text="%sections.right.section.model-editor.reference" />
<TextField fx:id="fieldValue" styleClass="field-view-text" />
CSS
.field-header-label{
-fx-pref-width: 460.0px;
}
.field-view-label {
-fx-pref-width: 460.0px;
}
.field-view-combobox {
-fx-pref-width: 460.0px;
}
.field-view-text {
-fx-pref-width: 460.0px;
}
答案 0 :(得分:2)
将Label
和TextField
中的每个VBox
换行,并为VBox
添加填充。类似的东西:
<VBox styleClass="control">
<Label styleClass="field-view-label" text="%sections.right.section.model-editor.fieldName" />
<TextField fx:id="fieldName" styleClass="field-view-text" />
</VBox>
<VBox styleClass="control">
<Label styleClass="field-view-label" text="%sections.right.section.model-editor.fieldType" />
<ComboBox fx:id="fieldDataType" styleClass="field-view-combobox" />
</VBox>
<VBox styleClass="control">
<Label styleClass="field-view-label" text="Field Reference" />
<ComboBox fx:id="fieldReference" styleClass="field-view-combobox" />
</VBox>
<VBox styleClass="control">
<Label styleClass="field-view-label" text="%sections.right.section.model-editor.reference" />
<TextField fx:id="fieldValue" styleClass="field-view-text" />
</VBox>
与
.control {
-fx-padding: 0 0 0 10 ;
}
/* ... */