My XAML is :
<listview:SfListView.ItemTemplate><DataTemplate><Grid ColumnDefinitions="Auto,20,Auto"><LabelMargin="0,0,10,0"FontSize="12"Text="{Binding eventTime}" /><Image Grid.Column="1" Source="{Binding logo}" /><LabelGrid.Column="2"FontSize="12"Text="{Binding}" /></Grid></DataTemplate></listview:SfListView.ItemTemplate>
As this the same in both Xamarin and Maui it appears that the sflistview does not handle the label that execeeds the width
Hi Lloyd,
We have checked the reported query” Maui label is not the same as Xamarin (and for such a simple control this is ?????)”, and we would like to inform you know that Xamarin.Forms Label and .NET MAUI Label will have a different appearance. We have attached the both screenshots for your reference.
|
Xamarin.Forms Label |
|
|
.NET MAUI Label |
|
Also please share the details regarding the UI , which you want to achieve your in sample which will be more helpful for us to find the solution as soon as possible.
Regards,
Suthi Yuvaraj
In both app's I have a SfListView with an ItemTemplate where the details of an event is one string. In the Xamarin app the Label (last one) if the string exceeds the width of the listview it will wrap automatically. This means there is a lot of code that is not required as the datatemplate did what I wanted it to do. Now I guess I will have to use some other control than a Label to do this.
We are able to reproduce the issue at our end when Grid.ColumnDefinition as "Auto" and label l text exceeds the screen size , the label text will not be wrapped properly. We are able to reproduce it at framework level with Grid and Label inside it and linebreakmode as "wordwrap". We have logged an issue at framework level. We recommend you use columndefinition as ‘*’ to overcome the issue . Refer to the below code snippet for more references.
|
<Grid ColumnDefinitions="*"> <Label Margin="0,0,10,0" FontSize="12" LineBreakMode="WordWrap" Text="As this the same in both Xamarin and Maui it appears that the sflistview does not handle the label that execeeds the widthAs this the same in both Xamarin and Maui it appears that the sflistview does not handle the label that execeeds the widthAs this the same in both Xamarin and Maui it appears that the sflistview does not handle the label that execeeds the width" /> </Grid> |
If your still facing the issue , please share the code snippet related to SfListView and ItemTemplate. which will be more helpful for us to find the solution as possible