1

I have this menu:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
        <item
            android:id="@+id/choosemap"
            android:title="اولین آیتم"/>
        <item
            android:id="@+id/choosespinner"
            android:title="abc" />
</menu>

And this is output:

enter image description here

I want to have Persian title rtl and English title ltr (now both of them are ltr), how can I do this?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
MMG
  • 3,226
  • 5
  • 16
  • 43

1 Answers1

1

Use right-to-left mark or even left-to-right mark in the string when it's needed,

left-to-right mark: &lrm; or &#x200e; (U+200E)
right-to-left mark: &rlm; or &#x200f; (U+200F)

explained here:

How to make the text direction from right to left

Example:

    android:title="\u200Fاولین آیتم"
Hafiza
  • 800
  • 8
  • 15