1

I want to append a text to String after adding new line starting from right to left in my android app example:

String g= "مرحبا";
g.append("\n اهلا");

so here the text start from the left, note that i am using a textView to display this String.

Amalo
  • 772
  • 3
  • 13
  • 32

1 Answers1

0

Depending on what result you want use one of these in the TextViews Layout:

android:textDirection="anyRtl"

(this sets text layout to Right-to-left)

android:gravity="right"

(this aligns the text on the right)

I think if you want to have some lines left and some right you could use html markup, but I'm not sure about that.

For other methods see How to make the text direction from right to left

Community
  • 1
  • 1
F43nd1r
  • 7,690
  • 3
  • 24
  • 62