Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RTL EditText broken pointer issue in Android

In rtl layout, edittext pointer gets broken in android devices.

I have an application which supports English and Arabic languages. In that the edit text fields with input type number is having this issue mainly. While entering numbers in edit text field, the pointer will break into two halves as shown in the image.

This is the xml code of the edittext.

    <EditText
            android:id="@+id/et_budget"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="15dp"
            android:background="@drawable/white_background_theme_border"
            android:ems="10"
            android:gravity="center"
            android:hint="@string/choose_budget"
            android:inputType="number"
            android:padding="15dp"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColorHint="@android:color/black" />

pointer break

Have someone experienced this issue. Is there any fix for the same. Thanks in advance.

like image 426
Viswas Kg Avatar asked Dec 06 '25 18:12

Viswas Kg


1 Answers

Have you tried this

Layout

<EditText>
    ... 
    android:gravity="right"
    android:textDirection="rtl"
</EdiText>

AndroidManifest.xml

<application
    ...
    android:supportsRtl="true">
    ...
</application>
like image 185
jelic98 Avatar answered Dec 08 '25 07:12

jelic98



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!