2

I have I guess simple problem however I cant find any solution to it. I have a textView in with width - wrap_content. I have it aligned to the right and inside linear layout. That linear layout might be max lets say 200dp so textView max width is 200dp too. Now whenever I type some text lets say: "Dhasdhjads. ahsdjhasd. hjashjdashjdhs." The two first words appear in first line and obviously the third word is moved to next because there is not enough space. However Eventho third word is not that wide that the first two, the textview takes max space instead of using only as much space as its needed. It looks like that

First Second--------------
Third word

---- is the free space that is beign taken instead of looking like that:

First Second
Third word

Any solution to this?

Well xml of my code Textview is:

 <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@android:color/black"
        android:singleLine="false"
        android:textColor="@android:color/white"/>
user3274539
  • 687
  • 2
  • 8
  • 18

2 Answers2

0

There is no solution for this, If you keep

singleLine = "false"

then android will set the text autometically as per space it found

Jayesh
  • 3,661
  • 10
  • 46
  • 76
0

Make android:singleLine="false" to android:singleLine="true"

Santosh Kathait
  • 1,444
  • 1
  • 11
  • 22