I use Persian text in my app which is a Right-to-left language like Arabic.
I want to change my text direction from LTR(default) to RTL but it seems there is no option to do it. I used direction: rtl
in my style but it doesn't work. I set text-align: right
and it is ok for text with only one line, but when my text is more than one line and I use textWrap="true"
in my Label so it doesn't work.
This is my code:
<StackLayout>
<Label horizontalAlignment="right"
text="اگر می خواهید رتبه فروشگاه ووکامرس خود را در صفحات نتایج موتورهای جستجو (SERPs) ارتقا دهید، تمرکز بر روی سئو امری ضروری است. برای بسیاری از افراد سئو بخشی پایانی طراحی است، اما کار بهتر پیش خواهد ..."
class="news-main__content" textWrap="true"></Label>
</StackLayout>
Update:
Finally, I found the solution myself to do that. Just use WebView
component and insert text-direction: rtl
inside of it.
NativeScript doesn't provide RTL support out of the box, yet. However, there is a plugin that provides this capability on Layout level. It can be set as a property of the layout or via CSS. The plugin can be found in the NativeScript Marketplace. Not sure if it will handle the text direction, though. But if not - you can give the author a hand and implement it together.