Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Limit the size of the textview horizontally

I have this text view

<TextView android:id="@+id/name"
          android:singleLine="true"
          android:layout_height="wrap_content"
          android:textColor="#ffffff" 
          android:textSize="16sp"  
          android:layout_width="fill_parent"/>

The problem is if the text is bigger then the textview can display it just stop displaying it looks something like this |some unfinished tex| I want to have dots on the end in this way it will be more clear to the user that this is unfinished and it it is displayed only a part of the text

I would prefer something like this |Some unfinished te..|

How to implement this ?

like image 823
Lukap Avatar asked Jan 31 '26 22:01

Lukap


1 Answers

Have you tried setting android:ellipsize paremeter to "end"?

like image 161
Mariusz Jamro Avatar answered Feb 02 '26 13:02

Mariusz Jamro



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!