Home > OS >  How to set the button in horizontal linearLayout with Persian language?
How to set the button in horizontal linearLayout with Persian language?

Time:01-22

I have to buttons in linearLayout. The linearLayout is horizontal.

My problem is when mobile language changes from English to Persian language because after that the position of buttons are swap each other.

How can I avoid that?

CodePudding user response:

LinearLayout is not support swap childView.

You can use FrameLayout or RelativeLayout to dynamically control the margin of this button from the top。

CodePudding user response:

In your AndroidManifest.xml you need to set supportsRtl=false to disable changing the layout to support RTL languages.

Like this:

<application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="false"
        >
  •  Tags:  
  • Related