Apache Pivot: BoxPane with one filling element
Can I make a BoxPane (for example vertically) where one of the components within the BoxPane fills the avaible space?
For example here I would like the ScrollPane to take all avaible space which is left after the Label. BXML:
<BoxPane orientation="vertical" styles="{fill:true}">
<Label text="Triggers:" />
<ScrollPa开发者_如何学JAVAne preferredWidth="80" preferredHeight="110"
horizontalScrollBarPolicy="fill"
verticalScrollBarPolicy="fill_to_capacity"
>
<ListView bxml:id="listTriggers" selectMode="single"
listData="['TRNIF_Trigger1'],['TRNIF_Trigger2'],['TRNIF_Trigger3']"
/>
</ScrollPane>
</BoxPane>
It looks like BoxPane in Pivot is designed to take only minimal needed space. You have to use TablePane. This looks a bit unfortune to me because your BXML blows up when using a large frontend which should adapt to available space. For example within WinForms I can say to a component "Stick to your right border with 5px distance and resize if needed to do so".
Nevertheless, here is the BXML for above question / example:
<TablePane styles="{padding:8, horizontalSpacing:6, verticalSpacing:6}">
<columns>
<TablePane.Column width="1*" />
</columns>
<TablePane.Row height="-1">
<Label text="Triggers:" />
</TablePane.Row>
<TablePane.Row height="1*">
<ScrollPane
horizontalScrollBarPolicy="fill"
verticalScrollBarPolicy="fill_to_capacity"
>
<ListView bxml:id="listTriggers" selectMode="single"
listData="['TRNIF_Trigger1'],['TRNIF_Trigger2'],['TRNIF_Trigger3']"
/>
</ScrollPane>
</TablePane.Row>
</TablePane>
精彩评论