I have a View to that I need to add some text. The used View 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 contains more than 3 line it just shows three line but no indication that it cut some line.
I want to append '...' at end of third line if it cut some data.
<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.
android:ellipsize="end"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With