I've been trying to make a ListView to work as RTL (Right to Left). I've added the following line in the ListView and LinearLayout properties:
android:layoutDirection="rtl"
and it still shows the list from left to right.
Any ideas?
Thank you all but I solved it with:
android:textDirection="rtl"
I've added it to the ListView and the layouts, and it worked. Next time you should try considering using this too for RTL layouts.
To take advantage of RTL layout mirroring, simply make the following changes to your app:
Declare in your app manifest that your app supports RTL mirroring.
Specifically, add android:supportsRtl="true"
to the <application>
element in your manifest file.
Change all of your app's left/right
layout properties to new start/end
equivalents.
If you are targeting your app to Android 4.2 (the app's
targetSdkVersion
or minSdkVersion
is 17 or higher), then you should
use start
and end
instead of left
and right
. For example,
android:paddingLeft
should become android:paddingStart
.
If you want your app to work with versions earlier than Android 4.2
(the app's targetSdkVersion
or minSdkVersion
is 16 or less), then you
should add start
and end
in addition to left
and right
. For
example, you’d use both android:paddingLeft
and android:paddingStart
.
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