Marquee TextView for application widget

I am developing an AppWidget where I need a TextView to display text as a selection area. I tried using the following code (as in normal 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 someone tell me how to fix this?

+6
android textview android-appwidget marquee
source share
3 answers

You need to add the following properties in xml to highlight:

  android:singleLine="true" android:ellipsize="marquee" android:marqueeRepeatLimit ="marquee_forever" android:scrollHorizontally="true" android:focusable="true" android:focusableInTouchMode="true" 
+4
source share

The template will appear when the contents of the Textview should be greater than the width. Make sure the entrance takes up more space than the width.

+2
source share

The text will scroll only if the TextView is in the selected or focused state, and, as Praveen points out, the text is wider than the available width of the TextView . I have not experimented with getting a TextView in selected or focused states in application widgets. Perhaps this or this previous StackOverflow answers will give you something to try.

0
source share

All Articles