如何在Xamarin.Forms ListView中创建手风琴效果

3
我如何在使用数据绑定的ListView中创建手风琴效果? 我正在使用Xamarin.Forms创建此应用程序。
以下是我目前的代码:
<ListView x:Name="List" HasUnevenRows="True" >
  <ListView.ItemTemplate>
    <DataTemplate>
      <ViewCell>
        <ViewCell.View>
          <Grid Padding="10,10,10,10">
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto"></RowDefinition>
              <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="*" />
              <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Label Text="ABC:-" FontSize="20" TextColor="Black" Grid.Column="0" Grid.Row ="0"/>
            <Label Text="{Binding ABC}" FontSize="20" TextColor="Black" Grid.Column="1" Grid.Row ="0" HorizontalOptions="EndAndExpand" VerticalOptions="FillAndExpand"/>
            <Label Text="XYZ:-" FontSize="20" TextColor="Black" Grid.Column="0" Grid.Row ="1"/>
            <Label Text="{Binding XYZ}" FontSize="20" TextColor="Black" Grid.Column="1" Grid.Row ="1" HorizontalOptions="EndAndExpand" VerticalOptions="FillAndExpand"/>
           </Grid>
        </ViewCell.View>
      </ViewCell>
    </DataTemplate>
  </ListView.ItemTemplate>
</ListView>

改善了格式。 - Knelis
你已经解决了这个问题吗?如果没有,您想要展开和折叠哪些元素?您想让每个“ViewCell”都能够展开和折叠,还是每个“ViewCell”中的每个“Grid”,或者每个“Grid”中的每个“Label”? - hvaughan3
@hvaughan3 每个视图单元格中的网格 - Atul Dhanuka
1个回答

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接