0

I have problem when I add text in arabic lag it showing from right side enter image description here

can you please help me to fix it?

    <?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:weightSum="2"
    android:padding="5dp"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <ImageView
        android:tint="#000"
        android:id="@+id/imgIcon"
        android:layout_width="40dp"
        android:layout_height="match_parent"
        android:gravity="center_vertical"
        android:layout_marginRight="15dp"
        android:layout_marginEnd="15dp"
        android:layout_marginTop="5dp"
        android:layout_marginBottom="5dp" />

    <TextView
        android:id="@+id/txtTitle"
        android:layout_weight="1"
        android:fontFamily="curier"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_vertical"
        android:textSize="17dp"
        android:textColor="#ff0000"
        android:text="@string/app_name"
        android:layout_marginTop="5dp"
        android:layout_marginBottom="5dp" />
</LinearLayout>
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115

1 Answers1

0

android:textDirection="locale"

This answer provided in the below link:

How to make the text direction from right to left

I don't have points to put this in comments. Please refer above link you can get. By default arabic text will get showed from right side from latest version. Arabic text letters will always start from right that's the reason.

Thank you

  • thank you !! it work after I delete this( android:gravity="center_vertical") from taxtview and I added this (android:textDirection="locale") Thank you so much – barmod mark Jul 20 '18 at 15:22
  • Okay actual credit goes to the person posted on above link thank you. – Vaishnavi K Jul 20 '18 at 16:05