I have a LinearLayout
and on some devices all the views are reversed.
The Good Version:
[b1] [b2] [b3]
On some devices:
[b3] [b2] [b1]
Why does that happen and how can I fix it?
If you're targeting and testing on API level >=17 (i.e. Android 4.2) this might be caused by RTL support, as described here.
If you don't want this, you can either change android:layoutDirection
for each particular view (and since the default is inherit
, the root view should suffice) or you can disable it for the whole application by setting android:supportsRtl="false"
in the AndroidManifest.xml file.
Or, you could also target an API level < 17, since it will then be disabled for compatibility (but this would lock you out of certain APIs).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With