-->

Text justification library in Java [duplicate]

2019-01-16 15:02发布

问题:

Possible Duplicate:
Can i set property of Textview like justify?

I'm writing an android app which needs text justification, which isn't supported natively, and I don't think using a WebView is going to work because of font and text sizes in relation to screen resolution and dimensions. With this in mind I'm going to write a custom view which extends the TextView which will do text justification and was wondering if anybody knows of any code I can look at which does this already to save me some time. Any other helpful advice would be greatly appreciated too.

回答1:

UPDATED

We have created a simple class for this. There are currently two methods to achieve what you are looking for. Both require NO WEBVIEW and SUPPORTS SPANNABLES.

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

SUPPORTS: Android 2.X to 5.X

SETUP

// Please visit Github for latest setup instructions.

SCREENSHOT