hacker
hacker

Reputation: 8957

Display long paragraph with alignment in android?

I just wanted to display a long text(Diff paragraphs and heading).What i tried is webview.But alignment and font size seems to be vague..Is there any other way to show long paragraphs in android ? Can anyone help me ?

Upvotes: 1

Views: 1124

Answers (1)

Padma Kumar
Padma Kumar

Reputation: 20041

You are applying changes to the webview as an object. What you need to do is create a css file and use that in whatever pages your webview is pointing to.

or

WebView page = (WebView) findViewById(R.id.webview);
String text = "<html><head>"
          + "<style type=\"text/css\">body{color: #ffdec2; background-color: #1F0C01;}"
          + "</style></head>"
          + "<body>"
          + "<p align=\"justify\">"                
          + getString(R.string.intro_content) 
          + "</p> "
          + "</body></html>";

page.loadData(text, "text/html", "utf-8");

Upvotes: 2

Related Questions