Right To Left in Xamarin ListView (SfListView)
8 Aug 20231 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 Vertical
and Horizontal
orientations. ListView supports RTL in Xamarin.Forms version 3.0 and above. It also supports RTL when device’s flow direction is changed.
NOTE
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.
NOTE
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 theHorizontalOptions
toStartAndExpand
in Label.
Limitation
- ListView item does not arrange from right to left direction in
Horizontal
orientation, when the AutoFitMode isHeight
orDynamicHeight
.
NOTE
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.
See also
How to work with swiping with RTL in Xamarin.Forms ListView (SfListview)