XML TextField, automatically response to RTL text and align it to right.
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/textview_first"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="سلااااااممممممم"
app:layout_constraintBottom_toTopOf="@id/button_first"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
* 
But, In Compose TextField, it's stick to left.
Is there any way to have TextField to align RTL text to right and LTR text to left?
Based on @Poran answer, you must add textStyle to TextField :
TextField(
value = name,
...
textStyle = TextStyle(color = Color.Black, textDirection = TextDirection.Content)
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With