怎么设置panel面板的垂直方向居中呢?例如:设置了panel的最小高度,然后panel里的文本向垂直方向上居中怎么设置呢?
this.GraphObject(go.Panel, "Vertical", {
defaultAlignment: go.Spot.Center,
stretch: go.GraphObject.Fill,
itemTemplate: this.GraphObject(go.Panel, "Horizontal",
this.GraphObject(go.TextBlock, textStyle(), {
margin: new go.Margin(0, 5, 5, 10),
spacingAbove: 5,
alignment: go.Spot.Center,
verticalAlignment: go.Spot.Center,
textAlign: "center"
},
new go.Binding("text", "key")),
this.GraphObject(go.TextBlock, textStyle(), {margin: new go.Margin(0, 10, 5, 0),spacingAbove: 5,stroke: "#117bfe",verticalAlignment: go.Spot.Center,},
new go.Binding("text", "text"))
)},
new go.Binding("itemArray", "items"),
new go.Binding("visible", "", function(nodeData, e){
return !!(nodeData.nodetype !== "datasource" && nodeData.status);
})
)