Android TextView Justify Text

前端 未结 29 1209
滥情空心
滥情空心 2020-11-22 03:28

How do you get the text of a TextView to be Justified (with text flush on the left- and right- hand sides)?

I found a possible solution here, but it do

29条回答
  •  心在旅途
    2020-11-22 04:15

    I think there are two options:

    • Use something like Pango that specializes in this via the NDK and render text to an OpenGL or other surface.

    • Use Paint.measureText() and friends to get the lengths of words and lay them out manually on a Canvas in a custom view.

提交回复
热议问题