-2

i have a simple question but i didn't how to solve i tried some stuff but didn't helpso i wanna know if i display a long text into a textview and it doesn't fit they just cut the last word i want to put "..." in the end if the text if it is too big for the textview. this is the textview code

 <TextView
    android:id="@+id/textView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginStart="60dp"
    android:layout_marginTop="15dp"
    android:layout_marginBottom="65dp"
    android:layout_weight="0.5"
    android:autoSizeTextType="uniform"
    android:clickable="true"
    android:gravity="left"
    android:text="TextView"
    android:textColor="#000"
    android:textSize="13sp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="1.0" />

enter image description here

1 Answers1

-1

You can add below code in your TextView

android:ellipsize="end"
android:maxLines="1"
tadev
  • 204
  • 1
  • 5