我观察到嵌套的StackLayout无法在DataTemplate中完全呈现。
具体来说,只会呈现name,labor和LaborCost。忽略所有其他值。
<ListView ItemsSource="{Binding Services}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.View>
<StackLayout Orientation="Vertical">
<Label Text="{Binding Name}" />
<StackLayout Orientation="Horizontal">
<Label Text="Labor:" />
<Label Text="{Binding LaborCost}" />
</StackLayout>
<StackLayout Orientation="Horizontal">
<Label Text="Materials:" />
<Label Text="{Binding Materials, Converter={StaticResource MaterialsToCostConverter}}" />
</StackLayout>
<Label Text="{Binding Description}" />
</StackLayout>
</ViewCell.View>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
有什么建议吗?
答案 0 :(得分:3)
向ListView添加了以下属性:
HasUnevenRows =&#34;真&#34;