[英]how to align text width in a Textview?
TextView
in Android O offers full justification (new typographic alignment) itself. Android O 中的
TextView
本身提供了充分的理由(新的排版对齐)。
You just need to do this,你只需要这样做,
textView.setJustificationMode(JUSTIFICATION_MODE_INTER_WORD);
default is JUSTIFICATION_MODE_NONE
You can use:您可以使用:
https://github.com/bluejamesbond/TextJustify-Android https://github.com/bluejamesbond/TextJustify-Android
Install Just add to your build.gradle安装只需添加到您的build.gradle
dependencies {
compile 'com.github.bluejamesbond:textjustify-android:2.1.6'
}
or或者
use : https://github.com/Saleh-Hassan/RTL-TextJustify-Android使用: https : //github.com/Saleh-Hassan/RTL-TextJustify-Android
Example:例子:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.