【问题标题】:How can I have one item of menu rtl and another one ltr?我怎样才能拥有一项菜单 rtl 和另一项 ltr?
【发布时间】:2020-05-09 06:38:30
【问题描述】:

我有这个菜单:

<?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>

这是输出:

我想要波斯标题rtl和英文标题ltr(现在都是ltr),我该怎么做?

【问题讨论】:

    标签: android menu menuitem


    【解决方案1】:

    在需要的时候在字符串中使用从右到左的标记,甚至是从左到右的标记,

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

    在这里解释:

    How to make the text direction from right to left

    例子:

        android:title="\u200Fاولین آیتم"
    

    【讨论】:

    • 如何为我的菜单执行此操作?请附上所需的代码。
    • android:title="\u200Fاولین ​​آیتم"
    • 如果它适合您,请附上您的输出图像。对我来说这是不正确的。
    猜你喜欢
    • 2017-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-07
    • 1970-01-01
    相关资源
    最近更新 更多