Right To Left in Xamarin ListView (SfListView)
17 May 20211 minute to read
SfListView supports to change the flow of text to the right-to-left direction by setting the FlowDirection to
RightToLeft in both
Horizontal orientations. ListView supports RTL in Xamarin.Forms version 3.0 and above. It also supports RTL when device’s flow direction is changed.
Specific platform setup is required to enable right-to-left localization. For platform settings you can refer here.
<ContentPage xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:syncfusion="clr-namespace:Syncfusion.ListView.XForms;assembly=Syncfusion.SfListView.XForms"> <ContentPage.Content> <syncfusion:SfListView x:Name="listView" FlowDirection="RightToLeft"/> </ContentPage.Content> </ContentPage>
listView.FlowDirection = FlowDirection.RightToLeft;
You can download the entire source code of this demo from here.
When a label is loaded in the
ItemTemplate, the right-to-left direction is not applied due to the framework issue. It has been reported to the Xamarin team; for more details about this, refer to this link. To overcome this issue, set the
- ListView item does not arrange from right to left direction in
Horizontalorientation, when the AutoFitMode is
You can refer to our Xamarin ListView feature tour page for its groundbreaking feature representations. You can also explore our Xamarin.Forms ListView example to know how to render set of data items with Xamarin.Forms views or custom templates.