Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
120 views
in Technique[技术] by (71.8m points)

java - Disable automatic layout change on Android

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.

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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>

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...