Collection view is not displaying any data
Closed this issue · 2 comments
Platform (please complete the following information):
- OS: [iOS]
- Device: [iPhone 12 pro max physical/iPhoneSimulators]
- Xamarin.Forms: [5.0.0.2578]
Describe the bug
Item template is not drawn on the screen when using the collection view. I can see that the collection view has a size but none of the items are being displayed. As you can see there is only red background of the collectionview but no yellow background of the item template.
This same code works on Android.
To Reproduce
Steps to reproduce the behavior:
Below is the piece of code that's causing all the issue.
`<sho:CollectionView
Grid.Row="3"
CollectionLayout="Vertical"
CollectionPadding="4"
DragAndDropEndedCommand="{Binding OnDragEndedCommand}"
DragAndDropTrigger="LongTap"
EnableDragAndDrop="True"
ItemHeight="80"
ItemWidth="120"
BackgroundColor="Red"
ItemsSource="{Binding ProfileItems}">
sho:CollectionView.ItemTemplate
<sho:DraggableViewCell
x:Name="DraggableViewCell"
x:DataType="dto:ProfileDto">
<Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
<CheckBox.Behaviors>
<behaviors:EventToCommandBehavior
EventName="CheckedChanged"
Command="{Binding BindingContext.ProfileItemSelectedCommand, Source={x:Reference This}}"
CommandParameter="{Binding}" />
</CheckBox.Behaviors>
<StackLayout
Grid.Column="1">
<Label
Text="{Binding FormattedBrand}"
TextColor="{StaticResource ColorSecondary}"
Style="{StaticResource BrandLabelStyle}"
LineBreakMode="WordWrap" />
<Label
Text="{Binding Description}"
LineBreakMode="WordWrap"
Margin="0,0,4, 0"
Style="{StaticResource BrandLabelStyle}"
TextColor="{StaticResource ColorPrimary}">
</Label>
</StackLayout>
<Label
Grid.Column="2"
VerticalOptions="Center"
Margin="10, 0"
Style="{StaticResource DragIcon}" />
</Grid>
</Frame>
</ContentView>
</sho:DraggableViewCell>
</DataTemplate>
</sho:CollectionView.ItemTemplate>
</sho:CollectionView>
`
Exceptions (if applicable)
No execeptions.
**Screenshots (if applicable)**
If applicable, add screenshots to help explain your problem.
Screenshot added.
![Simulator Screenshot - iPhone 14 Plus - 2023-07-18 at 23 02 33](https://github.com/roubachof/Sharpnado.CollectionView/assets/5573609/79c8508d-001f-4305-a03c-72cef25fe263)
I've got the same issue with Sharpnado collection for Maui on iPhones 13-14 with ios 16.6 and simulators. But on iPhone 10 with iOS 16.6 everything works fine. What is also interesting that previously when we were building our app with an earlier version of XCode 14.2 and the earlier version of the visual studio it also worked perfectly. Currently, we are unable to return back to previous versions. I really hope that this issue will be resolved fast, or I will be very thankful to get some help in case you think our team does something wrong!
This is fixed now. I was not using the right assembly for initializer in iOS