0

i have tried to use marquee but its not working,please help to solve this

<TextView
            android:id="@+id/text_from"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:ellipsize="marquee"
            android:fadingEdge="horizontal"
            android:singleLine="true"
            android:textColor="#343d43"
            android:textSize="18sp"
            android:textStyle="bold"
            app:layout_constraintEnd_toStartOf="@id/text_to"
            app:layout_constraintStart_toStartOf="@id/label_from"
            app:layout_constraintTop_toBottomOf="@id/label_from" />
Gautam Surani
  • 1,136
  • 10
  • 21

2 Answers2

1

android:singleLine is Deprecated. Use

android:maxLines="1"
android:focusable="true"

FYI

You should add setSelected

Changes the selection state of this view. A view can be selected or not. Note that selection is not the same as focus.

TextView text_fromOBJ=(TextView) findViewById(R.id.text_from);
text_fromOBJ.setSelected(true);
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198
0
android:focusable="true"
android:focusableInTouchMode="true"

you need add this lines in java

TextView txtView=(TextView) findViewById(R.id.text_from);
txtView.setSelected(true);
Venki WAR
  • 1,997
  • 4
  • 25
  • 38