Set Toolbar layout direction to RTL, with `supportsRtl=“false”`

只谈情不闲聊 提交于 2020-04-13 04:03:08

问题


I have a special situation that I am not able to find a solution for. I am trying to force a view to be laid-out in RTL, but one of the restrictions is that supportsRtl must be false in the manifest.

<!-- AndroidManifest.xml -->
<application android:supportsRtl="false">

<!-- layout/activity.xml -->
<android.support.v7.widget.Toolbar
    android:layoutDirection="rtl"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"/>

The problem I'm having is that android:layoutDirection and View#setLayoutDirection(int) are ignored unless supportsRtl="true". Short of making my own Toolbar, what other options are there for handling this?

来源:https://stackoverflow.com/questions/46650613/set-toolbar-layout-direction-to-rtl-with-supportsrtl-false

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!