Шатер с многоточием не работает с match_constraint - PullRequest
0 голосов
/ 21 марта 2019

У меня проблема при попытке сделать прокрутку текста.Это не работает, когда я устанавливаю ширину match_constraint.Вот мой xml:

<TextView
    android:id="@+id/songTextView"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_marginStart="8dp"
    android:layout_marginEnd="8dp"
    android:ellipsize="marquee"
    android:marqueeRepeatLimit="marquee_forever"
    android:scrollHorizontally="true"
    android:singleLine="true"
    android:textAlignment="center"
    app:layout_constraintEnd_toStartOf="@+id/totalDurationTextView"
    app:layout_constraintHorizontal_bias="0.508"
    app:layout_constraintStart_toEndOf="@+id/curPosTextView"
    app:layout_constraintTop_toBottomOf="@+id/seekBar" />

enter image description here

Когда я устанавливаю ширину для любого значения вместо 0dp (match_constraint), это работает.

android:layout_width="300dp"

enter image description here

Вот моя .java:

songNameTV = activity.findViewById(R.id.songTextView);
songNameTV.setSelected(true);
...