Search code examples
internationalizationxamarin.formsright-to-left

How to support right-to-left in xamarin.forms


How do I support right-to-left direction of pages in xamarin.forms? I have tried different layouts such as RelativeLayout and StackLayout and set its HorizontalOptions to start or end, but it does not swap the element. Anybody have any idea how we can achieve this?


Solution

  • Xamarin have started (or at least announced) work on internationalisation, including RTL. Currently it is not in yet though. A workaround for this in e.g. ListView is to create multiple list item templates with LTR/RTL directions and use them according to the current UI culture. For other controls your best bet would be to implement a renderer for each control type and change its HorizontalOptions or XAlignment according to the UI culture. You're basically forced to roll your own.