Wednesday, March 18, 2009

Marquee feature of TextView in Android 1.1R1

In the newest release, Android 1.1 R1, android.widget.TextView begins to support marquee feature.
It provides a value, marquee, for android:ellipsize, and a new attribute, android:marqueeRepeatLimit.

However you could not make the TextView scrolling if you only set these 2 attributes.
According to my testing, at least the following 3 attributes shall be set:
And the TextView shall be focused while running.

Moreover, I found 2 limitations in current marquee implementation:
  1. Never scroll if the TextView does not get the focuse;
  2. The scrolling is odd because the round of scrolling begins from the left side while end at the right side. It looks like the animation is reset.
So far, I think my implementation of ScrollTextView is better for the marquee feature. :)

1 comment: