0

enter image description hereI have an Android Application . i have a page called Terms and Conditions.. the page is called from the web service . the text are not justified . how to justify the text ?

2 Answers2

1

Android doesn't support text justification. The only thing you can do is apply android:gravity="center"

0

I'm assuming you're using XML layout.

<TextView  
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:gravity="center"
    android:text="YOURTEXT"
/>

add android:gravity="center" OR add yourTextview.setGravity(Gravity.CENTER); in JAVA

If you have text with HTML tags then you can use this like,

yourTextview.setText(Html.fromHtml("<h2>Title</h2><br><p>Description here</p>"));
Ganesh Pokale
  • 1,538
  • 1
  • 14
  • 28