如何在 NativeScript 中设置固定宽度的列?
How to set fixed width column in NativeScript?
我有一个三列的 gridLayout,如何设置中间列的固定宽度(百分比)和其他列的自动宽度?
我试过这个:
<GridLayout class="profiles" rows="auto, auto, auto" columns="*, 90%, *">
</GridLayout>
第一列可以设置固定宽度,第二列可以设置9倍到第三列。
<GridLayout columns="60, 9*, *" rows="*, *" height="230"
backgroundColor="lightgray">
<Label text="Label 1" row="0" col="0" backgroundColor="red"></Label>
<Label text="Label 2" row="0" col="1" backgroundColor="green"></Label>
<Label text="Label 3" row="0" col="2" backgroundColor="blue"></Label>
<Label text="Label 4" row="1" col="0" backgroundColor="yellow"></Label>
<Label text="Label 5" row="1" col="1" backgroundColor="orange"></Label>
<Label text="Label 6" row="1" col="2" backgroundColor="pink"></Label>
</GridLayout>
我已经为你创建了一个游乐场here。
我有一个三列的 gridLayout,如何设置中间列的固定宽度(百分比)和其他列的自动宽度?
我试过这个:
<GridLayout class="profiles" rows="auto, auto, auto" columns="*, 90%, *">
</GridLayout>
第一列可以设置固定宽度,第二列可以设置9倍到第三列。
<GridLayout columns="60, 9*, *" rows="*, *" height="230"
backgroundColor="lightgray">
<Label text="Label 1" row="0" col="0" backgroundColor="red"></Label>
<Label text="Label 2" row="0" col="1" backgroundColor="green"></Label>
<Label text="Label 3" row="0" col="2" backgroundColor="blue"></Label>
<Label text="Label 4" row="1" col="0" backgroundColor="yellow"></Label>
<Label text="Label 5" row="1" col="1" backgroundColor="orange"></Label>
<Label text="Label 6" row="1" col="2" backgroundColor="pink"></Label>
</GridLayout>
我已经为你创建了一个游乐场here。