4

I need to justify a text in Android without using a WebView, because i use it inside a listview, that create a lot of problems because of the recycle, when i scroll down it's okay, but when i get back up, the webview keep the size of the last one, but change the text. That means that sometime i get a text with a lot of space, it disrupt my ListView.

Is there a library for that ?

Tsunaze
  • 3,144
  • 7
  • 43
  • 81
  • 1
    Perhaps this could help you [how-can-i-set-property-of-textview-like-justify][1] [1]: http://stackoverflow.com/questions/5976627/can-i-set-property-of-textview-like-justify – Biagio Cannistraro Jul 02 '13 at 10:20

3 Answers3

2

Unfortunately you can't justify text on TextView, but it seems that someone found a solution, by creating is own class/library.

Read carefully the answers posted here and here. Hope it helps!

Community
  • 1
  • 1
JJ86
  • 5,016
  • 2
  • 34
  • 63
1

Well, Depends on how you want to justify the Text.

You could use

android:layout_gravity="center_vertical|right" //inside TextView

this will help the text right justified and there is also

android:gravity="right" // inside <TextView>

which will justify the text to right. Similarly left value will left justify.

Also Textview will have a default padding to support other language fonts.
Now you can disable this padding and justify the text further up by using

setIncludeFontPadding

blganesh101
  • 3,559
  • 23
  • 42
0

LIBRARY: https://github.com/bluejamesbond/TextJustify-Android

SETUP

// Please visit Github for latest setup instructions.

COMPARISON

Comparison.png

Mathew Kurian
  • 5,838
  • 5
  • 43
  • 72