I want to create listview inside listview. I tried below code, which is not working in Android, same code working perfectly in iOS
<local:CustomListview
x:Name="ListView"
ItemsSource="{Binding List1}" HasUnevenRows="True"
>
<local:CustomListview.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout
Orientation="Vertical">
<StackLayout Orientation="Horizontal">
<Label Text="{Binding Name}"></Label>
<Label Text="{Binding CreatedOn}"></Label>
</StackLayout>
<Label Text="{Binding Description}"></Label>
<StackLayout
Orientation="Horizontal"
>
<Label Text="{Binding Count}"></Label>
<Label Text="Likes(s)"></Label>
</StackLayout>
<StackLayout
Orientation="Vertical"
Padding="5, 0, 0, 0"
>
<local:CustomListview ItemsSource="{Binding List2}" HasUnevenRows="True">
<local:CustomListview.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Orientation="Vertical">
<Label Text="{Binding Description}"></Label>
<StackLayout Orientation="Horizontal">
<Label Text="{Binding CreatedBy}"></Label>
<Label Text="{Binding CreatedOn}"></Label>
</StackLayout>
</StackLayout>
</ViewCell>
</DataTemplate>
</local:CustomListview.ItemTemplate>
</local:CustomListview>
</StackLayout>
</StackLayout>
</ViewCell>
</DataTemplate>
</local:CustomListview.ItemTemplate>
</local:CustomListview>
Any suggestions?
I can't use group listview, since I need to arrange controls like Label in particular way. I am binding child listview as part of parent listview's ItemsSource. Above code is not working, its showing only parent listview, child listview is not displayed.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…