How to keep right to left in xamarin.forms

How do I maintain the right-to-left direction of pages in xamarin.forms? I tried different layouts, such as RelativeLayoutand StackLayout, and set it HorizontalOptionsto startor end, but it does not change the element. Does anyone know how we can achieve this?

+4
source share
2 answers

Hamarin began (or at least announced) internationalization work, including RTL. This is not all yet. A workaround for this, for example, ListViewis to create several list item templates with LTR / RTL directions and use them in accordance with the current culture of the user interface. For other controls, the best option would be to implement a visualization tool for each type of control and change it HorizontalOptionseither XAlignmentaccording to the culture of the user interface. You are basically forced to collapse your own.

+8
source

I am creating my own markup extension that will help you make rtl and ltr support, the extension has the following types:

  • GridLength
  • Layoutoption
  • TextAlignment
  • Int
  • ResourceKey

EX: , HorizontalOptions rtl, ltr, :  HorizontalOptions = "{UIExtensions: UIDirection Type = LayoutOption, LTR = Start, RTL = End}"

https://gist.github.com/ads90/ff5c69410d2654dcad3ed8d275d7ca20

0

Source: https://habr.com/ru/post/1681263/


All Articles