可在RTL中搜索

时间:2018-02-07 12:57:15

标签: android search android-recyclerview menu right-to-left

我已使用下面提到的链接实现了搜索recyclelerview。我希望它能正确对齐RTL,但搜索对于英语和阿拉伯语来说都是一样的,有没有办法可以设置它。

https://www.androidhive.info/2017/11/android-recyclerview-with-search-filter-functionality/

在我设置的清单中

    android:supportsRtl="true"

这是我可搜索的

<?xml version="1.0" encoding="utf-8"?>
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:hint="@string/search_hint"
android:label="@string/app_name"
/>

菜单

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="info.androidhive.recyclerviewsearch.MainActivity">
<item
    android:id="@+id/action_search"
    android:icon="@drawable/ic_search_black_24dp"
    android:orderInCategory="100"
    android:title="@string/action_search"
    app:showAsAction="always"
    app:actionViewClass="android.support.v7.widget.SearchView" />
    </menu>

我尝试将文字方向添加到可搜索但它不是属性。 我知道我可以为RTL支持做textDirection和LayoutDirection但不确定这个可搜索的我怎么能得到

这是我在阿拉伯语言上的形象。搜索图标和光标从左侧开始,但在阿拉伯语中它应该从右侧开始,我怎样才能使它工作?

任何建议都会非常有用,如果它不能以这种方式工作,请提供其他库的建议,我可以用来支持RTL。

感谢 [R

enter image description here

0 个答案:

没有答案