2

I have a text,and i want the end to be dotted when it doesn't fit in the text view anymore,like this "The text is leaving the scre..."

This is my xml,and it doesn't work

[![<TextView
            android:id="@+id/movie_overview_text"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_marginStart="8dp"
            android:layout_marginTop="24dp"
            android:layout_marginEnd="8dp"
            android:textStyle="bold"
            android:ellipsize="end"
            app:layout_constraintBottom_toBottomOf="@id/movie_overview_image"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@id/movie_overview_image"
            app:layout_constraintTop_toTopOf="@id/movie_overview_image" />

The text is simply getting out of the text view(The big text,the movie description,because at the cast te ellipsize is working)

Dragos Ciupe
  • 109
  • 1
  • 7

1 Answers1

-1

you can use android:maxLines="1" with android:ellipsize="end" in order for it to work.

  • wouldn't that put my text on one line?I want it on multiple lines like it already is,and the last line to be dotted at the end when the text reaches the textview's end – Dragos Ciupe Nov 18 '21 at 12:13
  • you should check this out bro https://stackoverflow.com/questions/10748796/android-how-to-limit-width-of-textview-and-add-three-dots-at-the-end-of-text] – Shahid Iqbal Nov 18 '21 at 13:03