https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/collectionview#populating-a-collectionview-with-data
When I add the Xaml code of CollectionView to my project, I find that it can't run, and I will report the following _error: System.TypeInitializationException: The type initializer for 'Xamarin.Forms.ItemsView' threw an exception._
<StackLayout>
<!-- Place new controls here -->
<Label Text="Welcome to Xamarin.Forms!"
HorizontalOptions="Center"
VerticalOptions="CenterAndExpand" />
<CollectionView>
<CollectionView.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Baboon</x:String>
<x:String>Capuchin Monkey</x:String>
<x:String>Blue Monkey</x:String>
<x:String>Squirrel Monkey</x:String>
<x:String>Golden Lion Tamarin</x:String>
<x:String>Howler Monkey</x:String>
<x:String>Japanese Macaque</x:String>
</x:Array>
</CollectionView.ItemsSource>
</CollectionView>
</StackLayout>
System.TypeInitializationException: The type initializer for 'Xamarin.Forms.ItemsView' threw an exception.
https://www.dropbox.com/s/6ocl8e3g4azluxw/AppForms3.rar?dl=0
VS bug #824637
Please add Forms.SetFlags("CollectionView_Experimental");
to your AppDelegate and MainActivity, as described in the paragraph above section you linked to in the documentation. Thanks!
Most helpful comment
Please add
Forms.SetFlags("CollectionView_Experimental");
to your AppDelegate and MainActivity, as described in the paragraph above section you linked to in the documentation. Thanks!