Using a CollectionView where the ItemTemplate has a ContentView with a Label does not display anything in the CollectionView. This seems to work on iOS.
<CollectionView x:Name="colv">
<CollectionView.ItemTemplate>
<DataTemplate>
<ContentView>
<Label Text="{Binding Text}"></Label>
</ContentView>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
public class T
{
public string Text { get; set; }
}
List<T> cc = new List<T>();
public MainPage()
{
InitializeComponent();
for(int i = 0; i < 10; i++)
{
cc.Add(new T { Text = "p" + i });
}
colv.ItemsSource = cc;
}
Show the items in the collectionview
Nothing is shown in the collectionview
Might be related to: https://github.com/xamarin/Xamarin.Forms/issues/6355
This is fixed in 4.1.0.496342-pre2.
Thanks @hartez ! Works like a charm!
Most helpful comment
This is fixed in 4.1.0.496342-pre2.