在Android上禁用自动布局更改 [英] Disable automatic layout change on Android

查看:63
本文介绍了在Android上禁用自动布局更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经制作了一个应用程序,已经对其进行了测试,并且可以在手机上正常使用.但是...当我将.apk交给电话语言为RTL的其他人时,整个布局崩溃了,它弄乱了所有东西.

I've made an app, I've tested it and it was fine on my phone. But... when I gave the .apk to someone else whose phone language is RTL the whole layout broke and it messed up everything.

我的问题是-如何强制我的应用程序仅使用LTR并禁用自动布局更改,这会破坏我的整个应用程序设计?

My question is - How can I force my app to use only LTR and disable the auto layout change which breaks my whole app design?

推荐答案

在清单文件中和application标记内添加这两行.

In your manifest file and inside the application tag add these two lines.

<manifest>
    <application
        .
        .
        .
        android:supportsRtl="false"
        tools:replace="android:supportsRtl" //(replace libraries' Rtl support with ours)
        >
    </application>
</manifest>

注意:(关于第二行) 一些库在其清单文件中支持Rtl,因此,如果要使用这些库,必须将它们的清单行替换为您的清单行.

Note: (about second line) Some libraries have support Rtl in their manifest file so if you want to use those libraries you must replace their manifest line of code with yours.

这篇关于在Android上禁用自动布局更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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