In my application, I have an TextView
with many lines beside of product, but I need the data with proper appearance.Is it possible to have justified alignment dynamically?
Asked
Active
Viewed 564 times
1

Praful Bhatnagar
- 7,425
- 2
- 36
- 44

Neeha
- 727
- 3
- 9
- 21
-
check this: http://stackoverflow.com/a/15894704/1168654 – Dhaval Parmar Apr 09 '13 at 07:29
-
[Android – How to display information with justify alignment?](http://www.technotalkative.com/android-how-to-display-information-with-justify-alignment/) – Paresh Mayani Apr 09 '13 at 07:33
-
no you can not justify the text inside a textview. you can try with Hmtl.format() – Blackbelt Apr 09 '13 at 07:37
-
Thank you Paresh Mayani, In the above link static text mentioned but my text dynamic text then how it is possible – Neeha Apr 09 '13 at 08:02
3 Answers
1
you can align your text dynamically some how as you want...
but, i guess there is no such facility available in android to fully justify text as the text editors does...

karan
- 8,637
- 3
- 41
- 78
-
watch...stackoverflow.com/questions/1292575/android-textview-justify-text?rq=1 – karan Apr 09 '13 at 07:33
-
for this purpose some programmers also use web view...refer this...http://www.seal.io/2010/12/only-way-how-to-align-text-in-block-in.html – karan Apr 09 '13 at 08:08
0
Use Html Formatting in your textView like
yourTextView.setText(Html.fromHtml("<h1>Product Name</h1><br><p>Content</p>"));

Arun C
- 9,035
- 2
- 28
- 42
-
I think question is **Is it possible to have justified alignment dynamically?** – Paresh Mayani Apr 09 '13 at 07:32
0
Yes you can get the instance of TextView on activity startup
TextView t = (TextView)FindViewById(R.id.TextView1)
t.setTextAppearance(context,parameter)

Naga
- 1,931
- 4
- 25
- 42
-
I think question is **Is it possible to have justified alignment dynamically?** – Paresh Mayani Apr 09 '13 at 07:32
-
1"but I need the data with proper appearance" I considered this lines in the question – Naga Apr 09 '13 at 07:59