I'm working on an android application with arabic version.
In one of the interfaces, I have gridView. So to display items in the correct order, I have to display items in the GridView from the right to the left (and of corse from the top to the bottom). To do that, I tried to add these attributes in the GridView :
android:gravity="right"
android:layout_gravity="right"
Unfortunately, items still displayed from the left to the right.
any idea to do it in the right way ?
You can achieve this by this ugly workaround:
add this line to your GridView in XML:
android:rotationY="180"
also add the same line to your GridView item in XML:
android:rotationY="180"
In total it gives you rotation by 360° so it looks like GridView places items from right to left.
add this line to your GridView in XML:
android:layoutDirection="rtl"
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