禁用ActionBar RTL方向 [英] Disable ActionBar RTL Direction

查看:109
本文介绍了禁用ActionBar RTL方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android 4.2引入了对RTL(BiDi)的支持,要开始使用它,我只需按照说明进行操作即可(清单文件中元素的android:supportsRtl属性并将其设置为"true")

Android 4.2 introduced RTL (BiDi) support, to start using it I just follow the instructions (android:supportsRtl attribute to the element in your manifest file and set it "true")

但是,然后,我的ActionBar徽标也将不需要的方向更改为右侧(徽标显示在右侧). 我确实想使用RTL功能,但要使ActionBar保持向左...

But then my ActionBar logo also changes orientation to the right (Logo is displayed on the right) which I don't want. I do want to use the RTL features but keep the ActionBar oriented to the left...

换句话说,当语言方向为RTL时,如何在不更改Android 4.2上的ActionBar方向的情况下使用android:supportsRtl属性

In other word, how do I use the android:supportsRtl attribute without it changing the ActionBar direction on Android 4.2 when the language direction is RTL

有什么建议吗?

推荐答案

首先,对不起,ActionBar应该在RTL模式下进行镜像.这一点已经由比迪/rtl专家检查和验证.设置android:supportsRtl = true表示您的应用愿意支持RTL布局镜像.如果这样做,则会对ActionBar(与每个Android Framework小部件一样)进行镜像,因为在LTR方向上显示它是没有意义的.

First, no sorry, the ActionBar should mirror when you are in RTL mode. This point has been checked and validated by bidi/rtl experts. Setting android:supportsRtl=true means that your app is willing to support RTL layout mirroring. If you do so then the ActionBar (as every Android Framework widgets) will be mirrored as it does not make sense to show it in LTR direction.

第二,关于访问左上或右上菜单的屏幕尺寸和人体工程学问题的论点与RTL支持无关.如果在LTR模式下存在此类问题,那么在RTL模式下您将遇到完全相同的问题.这仅与屏幕尺寸有关.

Second, your argument about screen size and ergonomics issues for accessing a top left or top right menu is not related to RTL support. If there is such issue in LTR mode then you will have the exact same issue in RTL mode. This is only related to the screen size.

第三,所有Android UI框架小部件本身都支持RTL镜像.如果发现问题,请在公共错误跟踪系统上提交错误.

Third, all Android UI Framework widgets are natively supporting RTL mirroring. If you find an issue, please file a bug on the public bug tracking system.

第四,Google Apps将支持RTL布局,并在需要时使用这些新的公共RTL API.这与Android Framework支持完全无关.第一个支持RTL的应用是设置"应用(将一些尚不支持RTL的提供程序作为模数).

Fourth, Google Apps will support RTL layouts and use those new public RTL APIs when they wish to do so. This is totally decorelated from Android Framework support. The first app to support RTL was the Settings apps (modulo some of its providers that are not yet RTL aware).

第五,关于反向移植,我假设您是在谈论是否应将此功能放在支持库中,甚至应该放在较旧的Android版本中.对于较旧的Android版本,无法完成此操作,因为其代码库已冻结.对于支持库,我们无能为力,因为我们不得不更改View和其他基本窗口小部件组件.

Fifth, concerning backport, I am supposing that you are talking about if this feature should be either put in the Support Library or even in older Android releases. For older Android release, this cannot not be done as their codebase is frozen. For the Support Library, we cannot do it as we had to change View and other basic widgets component.

如果您认为已发现问题或只是对可能缺少的任何内容提出功能请求,则最后采取更具建设性的方法并提交错误报告.

Last be more constructive in you approach and file a bug report if you think you have found an issue or just file a feature request for anything that could be missing.

这篇关于禁用ActionBar RTL方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆