Search code examples
androidright-to-left

Is it possible to switch between text views based on language?


I'm trying to find a way to switch between text views based on language, because some languages like hebrew and arabic are from right to left, so if I have two text views for example first text view says Park Name: and the second one says Central park which sums it up to Park Name: Central Park, I need to reverse that to Central Park :Park Name, which concludes to just swapping their location, any idea how this could be done?


Solution

  • What is the layout? If you use RelativeLayout, then you'll find

    android:layout_alignParentStart="true" // for the Park Name
    android:layout_alignParentEnd="true" // for the Central Park
    

    Thus will automatically swapping the location based on language