Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Marquee TextView on App Widget

I am developing an AppWidget where I need a TextView to display text as a marquee. I have tried using the following code (as one would do in a regular Activity), but the text does not scroll.

<TextView
    android:layout_width="150dip" 
    android:layout_height="wrap_content"
    android:text="@string/marquee_forever"
    android:singleLine="true"
    android:ellipsize="marquee"
    android:marqueeRepeatLimit="marquee_forever" />

Can anyone tell me how to fix this?

like image 884
Leo Avatar asked Oct 04 '10 10:10

Leo


2 Answers

You required to add the following properties in xml for marquee:

    android:singleLine="true" 
    android:ellipsize="marquee"
    android:marqueeRepeatLimit ="marquee_forever"
    android:scrollHorizontally="true"
    android:focusable="true"
    android:focusableInTouchMode="true"
like image 178
Sandy Avatar answered Nov 02 '22 11:11

Sandy


The marquee will appear when the content of the Textview should be larger than width.Make sure the input occupies the greater space than width.

like image 25
Praveen Avatar answered Nov 02 '22 11:11

Praveen