How do I JUSTIFY align text in a static layout programmatically? Thanks for your time.
I only see the following options for staticLayout.setAlignment()
:
Layout.Alignment.ALIGN_CENTER
Layout.Alignment.ALIGN_NORMAL
Layout.Alignment.ALIGN_OPPOSITE
CodePudding user response:
You can set it like textView.justificationMode = JUSTIFICATION_MODE_INTER_WORD
. But it requires Android O (Api level 26).
source: https://stackoverflow.com/a/42991773/19115089
Another option would be to try a third party library like https://github.com/mathew-kurian/TextJustify-Android (but no longer maintained)