1

I am using this code to do auto scroll when length of testView is exceed to screen width:-

<TextView
            android:id="@+id/tViewWork"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ellipsize="marquee"
            android:fadingEdge="horizontal"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:gravity="center_vertical"
            android:marqueeRepeatLimit="marquee_forever"
            android:padding="3dp"
            android:scrollHorizontally="true"
            android:selectAllOnFocus="true"
            android:singleLine="true"
            android:text="Name of work: "
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textColor="#dedfdc"
            android:textStyle="bold" />

I want to scroll the character without three dot. The above code scrolling the character but at the end three dot is displaying.

enter image description here

Vinit ...
  • 1,409
  • 10
  • 37
  • 66

3 Answers3

0

Try this, Add below attributes to your TextView. You are missing android:ellipsize="marquee" attribute in your xml

   android:ellipsize="marquee"
   android:focusable="true"
   android:marqueeRepeatLimit="marquee_forever"
   android:singleLine="true"

And also set selected true for you TextView in java code

  TextView tViewWork = (TextView) findViewById(R.id.tViewWork);
  tViewWork.setSelected(true);
Murali Ganesan
  • 2,925
  • 4
  • 20
  • 31
0

try below code :

<TextView android:id="@+id/fact" android:layout_width="200dp"
    android:text="Loading... More text to see if it spans or not and want more"
    android:singleLine="true" 
    android:ellipsize="marquee"
    android:marqueeRepeatLimit ="marquee_forever"
    android:scrollHorizontally="true"
    android:focusable="true"
    android:focusableInTouchMode="true"
    android:duplicateParentState="true">
<requestFocus android:focusable="true" android:focusableInTouchMode="true"
    android:duplicateParentState="true" />

Refer : TextView Marquee not working

Community
  • 1
  • 1
Thirumoorthy
  • 589
  • 2
  • 11
-1

remove
android:singleLine="true" it will automatically takes as much width and height as it wants

Venkat
  • 64
  • 4