Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 662
priya_d Avatar asked Jan 31 '23 00:01

priya_d


1 Answers

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.

like image 53
Steven Thewissen Avatar answered May 15 '23 12:05

Steven Thewissen