How to add the rounded corner items for .NET MAUI ListView(SfListView)?
The .NET MAUI ListView allows you to customize the item appearance, such as adding rounded corners, using the Frame layout in the ItemTemplate property.
XAML
Define the CornerRadius property for the Frame to apply rounded corners to the items.
<listView:SfListView x:Name="listView" ItemSize="80" BackgroundColor="#dfe0df" ItemsSource="{Binding ContactsInfo}" > <listView:SfListView.ItemTemplate> <DataTemplate> <Frame x:Name="frame" CornerRadius="10" Margin="10" Padding="0" HasShadow="False"> <Grid Padding="10,0,0,0" > <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Grid Grid.Column="0" RowSpacing="1" VerticalOptions="Start"> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Label LineBreakMode="NoWrap" Text="{Binding ContactName}" FontSize="15" FontAttributes="Bold" HorizontalTextAlignment="Start" VerticalTextAlignment="Center"/> <Label Grid.Row="1" LineBreakMode="NoWrap" Text="{Binding ContactNumber}" HorizontalTextAlignment="Start" VerticalTextAlignment="Start"/> </Grid> <Label LineBreakMode="NoWrap" Text="{Binding ContactType}" FontSize="12" Grid.Column="1" VerticalTextAlignment="Center" HorizontalTextAlignment="End" Padding="10"/> </Grid> </Frame> </DataTemplate> </listView:SfListView.ItemTemplate> </listView:SfListView>
Download the complete sample on GitHub
Conclusion
I hope you enjoyed learning how to add a rounded corner to .NET MAUI ListView items.
You can refer to our .NET MAUI ListView feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started with configuration specifications. You can also explore our .NET MAUI ListView example to understand how to create and manipulate data.
For current customers, check out our components from the License and Downloads page. If you are new to Syncfusion®, try our 30-day free trial to check out our other controls.
Please let us know in the comments section below if you have any queries or require clarification. Contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!