Ellipsize not behaving like it's supposed to android studio xml

202 views Asked by At

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)

1

There are 1 answers

2
Shahid Iqbal On

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