Elad Benda Elad Benda - 1 month ago 8
Java Question

how to create android linearlayout with RTL horizontal orientation

I want to create a linear layout with horizontal orientation

but I want it to position its children aligned to its right and not to its left as usual

how can I do this?

I know how to do this using relativeLayout, but I want to practice linearLayout

Answer

You can use android:layoutDirection attribute which is introduced in 4.2(jelly bean).

The following links will help.

http://developer.android.com/reference/android/view/View.html#attr_android:layoutDirection

http://android-developers.blogspot.co.uk/2013/03/native-rtl-support-in-android-42.html

Comments