We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Maui label is not the same as Xamarin (and for such a simple control this is ?????)

My XAML is :

  1. <listview:SfListView.ItemTemplate>
  2. <DataTemplate>
  3. <Grid ColumnDefinitions="Auto,20,Auto">
  4. <Label
  5. Margin="0,0,10,0"
  6. FontSize="12"
  7. Text="{Binding eventTime}" />
  8. <Image Grid.Column="1" Source="{Binding logo}" />
  9. <Label
  10. Grid.Column="2"
  11. FontSize="12"
  12. Text="{Binding}" />
  13. </Grid>
  14. </DataTemplate>
  15. </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


3 Replies

SY Suthi Yuvaraj Syncfusion Team October 31, 2022 04:34 PM UTC

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



LS Lloyd Sheen October 31, 2022 04:39 PM UTC

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.



SY Suthi Yuvaraj Syncfusion Team November 1, 2022 02:54 PM UTC

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


Loader.
Live Chat Icon For mobile
Up arrow icon