Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Collection View Clicked not working in .NET MAUI

I have added a collection view in my .NET MAUI application where I have used the following code inside my collection view.

  <Border Padding="10,0,10,0" Margin="3,3,3,3" StrokeShape="RoundRectangle 5,5,5,5" BackgroundColor="White">
                                <Grid RowSpacing="5">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Frame Grid.Row="0" HeightRequest="200" WidthRequest="250" CornerRadius="0" Padding="0" IsClippedToBounds="True">
                                        <Image Source="{Binding FullImageUrl}" Aspect="Fill"/>
                                    </Frame>
                                    <Label Grid.Row="1" FontSize="Subtitle" Text="{Binding Name}" Padding="15,0"/>
                                    <Label Grid.Row="2" FontSize="Small" Text="{Binding Address}" WidthRequest="250" Padding="15,0" LineBreakMode="TailTruncation"/>
                                    <Label Grid.Row="3" FontSize="Subtitle" TextColor="#1d94ab" Padding="15, 0" Text="{Binding Price}"/>
                                </Grid>
                            </Border>

The clicked event of the collection view is not working. When I don’t use Frame then it works but with Frame it doesn’t work. I need Frame because I want a rounded corner cells in my collection view.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

It’s a bug in .NET MAUI android version. On IOS Frame inside the collection view works perfectly but there’s a problem with the android version. I’ll suggest you to use Border Control instead of Frame because with Border control you can also use the rounded corners or corner radius and the clicked event will work on both ios and android.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading