views:

62

answers:

3

Hi, I have a lsit view and i that i need to add some text. in the adapter, the textview i used is

<TextView android:layout_marginLeft="10dp" android:layout_width="wrap_content"
  android:gravity="center_vertical"
   android:layout_gravity="center" android:maxLines="3"
   android:layout_height="70dp" android:textColor="#000000"
   android:textSize="12dp" />

The problem i have is, if this text i need to display is contains more than 3 line it just shows three line but no indication that it need have cut some line.
i just need to append '...' at end of third line if it cut some data.

A: 
android:ellipsize="end"
fedj
Thanks for that answer but still i have some problem and i posted on http://stackoverflow.com/questions/4021293/android-append-at-the-end-textview-edit
Labeeb P
add android:scrollHorizontally="true"
fedj
A: 
<TextView android:layout_marginLeft="10dp" android:layout_width="wrap_content"
  android:gravity="center_vertical"
   android:layout_gravity="center" android:maxLines="3"
   android:layout_height="70dp" android:textColor="#000000"
   android:textSize="12dp" android:ellipsize="end"/>

add android:ellipsize="end"

blindstuff
Thanks for that answer but still i have some problem and i posted on http://stackoverflow.com/questions/4021293/android-append-at-the-end-textview-edit
Labeeb P
+1  A: 
<TextView android:layout_marginLeft="10dp" 
   android:layout_width="wrap_content" 
   android:gravity="center_vertical" 
   android:layout_gravity="center" 
   android:maxLines="3" 
   android:layout_height="70dp" 
   android:textColor="#000000" 
   android:textSize="12dp" 
   android:ellipsize="end"/> 

Use this code and it will work fine, the code android:ellipsize="end" will change this for you.

Samuel
wow way to post this 15 min after I click go phone >.<
Samuel
Thanks for that answer but still i have some problem and i posted on http://stackoverflow.com/questions/4021293/android-append-at-the-end-textview-edit
Labeeb P