Android 自带的 TextView 的对齐方式只能左对齐或者右对齐,如果想要两端都对齐就需要自定义控件,但是有一个更简单的方法就是使用 WebView, 通过设置 text-align:justify 就可以
XML 文件:Java 文件
final String templateWebViewContent = "%s
"; WebView webView = findViewById(R.id.webview); webView.setVerticalScrollBarEnabled(false); webView.loadData(String.format(templateWebViewContent, yourContent), "text/html", "utf-8");



