Justify text in textview

前端 未结 7 2136
有刺的猬
有刺的猬 2020-12-08 12:40

In my app first I have textview to show text. Then I want to justify text but in android its not possible to justify text in textview. To justify text I am taking help from

7条回答
  •  無奈伤痛
    2020-12-08 12:51

    How to justify text in Android without using any Library See More code.

    Create a activity and paste following code See More

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
       WebView webView= (WebView) findViewById(R.id.webView);
       WebSettings  webSettings=webView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        String htmlText = " %s ";
        String myData = "The E-Learning Application is a Mobile based application.
            The main objective of this application is to make it interactive 
        and its ease of use.The main features that the application provides are 
        online tutorial and tests, once the registered people select their 
        interested subjects. 
    This helps to establish incremental learning process. Users can also discuss an issue/topic by posting messages in the discussion forum. Along with this they can also take real time simulations of the most widely known competitive exams."; webView.loadData(String.format(htmlText,myData),"text/html","utf-8"); }

提交回复
热议问题