问题
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:
I want to have Persian title rtl and English title ltr (now both of them are ltr), how can I do this?
回答1:
Use right-to-left mark or even left-to-right mark in the string when it's needed,
left-to-right mark: ‎ or ‎ (U+200E)
right-to-left mark: ‏ or ‏ (U+200F)
explained here:
How to make the text direction from right to left
Example:
android:title="\u200Fاولین آیتم"
来源:https://stackoverflow.com/questions/61692792/how-can-i-have-one-item-of-menu-rtl-and-another-one-ltr