Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android:ellipsize="end" and android:maxEms not working

I added

android:ellipsize="end"
android:maxEms="8"
android:singleLine="true"

to my TextView with the intention of showing three dots at the end and max text limit of 8 but it's not working. It shows neither the dots nor any text limit.

like image 703
Android Developer Avatar asked Dec 11 '15 18:12

Android Developer


People also ask

What is Android Ellipsize end?

Android Ellipsize Android TextView ellipsize property Causes words in the text that are longer than the view's width to be ellipsized ( means to shorten text using an ellipsis, i.e. three dots …) instead of broken in the middle to fit it inside the given view.

What is Ellipsize marquee Android?

If you want a horizontal scrollable text in your app, use android:ellipsize="marquee" where a single line large text will be scrolling.

What is EMS in TextView?

ems is a unit of measurement. The name em was originally a reference to the width of the capital M. It sets the width of a TextView/EditText to fit a text of n 'M' letters regardless of the actual text extension and text size. Eg : android:ems Makes the EditText be exactly this many ems wide.


1 Answers

For some reason, I accidentally had put

android:inputType="textCapSentences"

on my TextView which prevented my ellipses from showing

like image 135
nilsi Avatar answered Sep 20 '22 07:09

nilsi