Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

CollectionView doesn't work in iOS

$
0
0

Hello, am trying to use collection view as following
<CollectionView x:Name="ColorCollectionView" Margin="5" HeightRequest="250" WidthRequest="250" ItemSizingStrategy="MeasureFirstItem" ItemsSource="{Binding Categories}" SelectedItem="{Binding SelectedCategory, Mode=OneWayToSource}" SelectionChangedCommand="{Binding SelectedItemChangedCommand}" SelectionChangedCommandParameter="{Binding Source={x:Reference ColorCollectionView}, Path=SelectedItem}" SelectionMode="Single" VerticalOptions="Center"> <CollectionView.ItemsLayout> <GridItemsLayout Orientation="Horizontal" Span="2" /> </CollectionView.ItemsLayout> <CollectionView.ItemTemplate> <DataTemplate> <StackLayout Padding="20,0" Spacing="0"> <Frame Padding="10" BackgroundColor="White" BorderColor="{Binding BackgroundSelectedColor}" CornerRadius="100" HasShadow="False"> <Image HeightRequest="60" Source="{Binding Image}" WidthRequest="60" /> </Frame> <Label FontFamily="{x:Static constants:Fonts.Medium}" FontSize="12" HorizontalOptions="Center" Text="{Binding Name}" TextColor="Black" /> </StackLayout> </DataTemplate> </CollectionView.ItemTemplate> </CollectionView>
and it work fine in android but I got this exception in iOS

=================================================================

Managed Stacktrace:

  at <unknown> <0xffffffff>
  at ObjCRuntime.Messaging:nint_objc_msgSend_nint <0x0011f>
  at UIKit.UICollectionView:NumberOfItemsInSection <0x0017a>
  at Xamarin.Forms.Platform.iOS.GridViewLayout:NeedsPartialColumnAdjustment <0x00282>
  at Xamarin.Forms.Platform.iOS.GridViewLayout:get_CollectionViewContentSize <0x000da>
  at Xamarin.Forms.Platform.iOS.ItemsViewLayout:TrackOffsetAdjustment <0x000f3>
  at Xamarin.Forms.Platform.iOS.ItemsViewLayout:PrepareLayout <0x000ca>
  at System.Object:runtime_invoke_void__this__ <0x001e5>
  at <unknown> <0xffffffff>
  at UIKit.UIApplication:UIApplicationMain <0x002a1>
  at UIKit.UIApplication:Main <0x000d2>
  at UIKit.UIApplication:Main <0x00152>
  at Planilaque.iOS.Application:Main <0x000b2>
  at <Module>:runtime_invoke_void_object <0x001e8>

can any one help me?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>