Updated 18 December 2016
How to align-justify a Paragraph if TextView is not align-justify the Text?
By using the WebView we can align a text to justifying text for both RTL and LTR supported Languages.
Just follow the following easy steps.
1 2 3 4 5 6 7 8 |
<WebView android:id="@+id/webView" android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="visible" android:layout_marginBottom="10dp" android:padding="10dp" /> |
1 2 3 4 |
String text; text = "<html><body dir=\"rtl\"; style=\"text-align:justify;\">"; text += Your_Content_String; text += "</body></html>"; |
1 2 3 4 |
String text; text = "<html><body style=\"text-align:justify;\">"; text += Your_Content_String ; text += "</body></html>"; |
1 |
((WebView) v.findViewById(R.id.webView)).loadData(text, "text/html; charset=UTF-8", "utf-8"); |
1 |
((WebView) v.findViewById(R.id.webView)).loadData(text, "text/html", "utf-8"); |
If you have more details or questions, you can reply to the received confirmation email.
Back to Home
Be the first to comment.