The marquee is that textview cannot accommodate content and must be displayed in the form of a playback animation.
1, usually, many people only need to implement a textview of the horse, just need to add the following section in the textview attributes (specific parameters represent the meaning, please refer to here http://www.cnblogs.com/over140/archive/2010/08/27/1809745.html)
android:layout_marginRight="20dp" android:ellipsize="marquee" android:focusable="true" android:marqueeRepeatLimit="marquee_forever" android:focusableInTouchMode="true" android:scrollHorizontally="true" android:singleLine="true"
2. If you need to implement multiple textviews on the same page, you will find that there is always only one textview, and nothing else works. Why? Because there is a very important parameter for the implementation of the running horse lamp effect, that is, whether it is isfocused. Therefore, you only need to inherit textview and override the isfocused method, as shown below:
public class TextViewMarquee extends TextView {public TextViewMarquee(Context context) {super(context);}public TextViewMarquee(Context context, AttributeSet attrs, int defStyle) {super(context, attrs, defStyle);}public TextViewMarquee(Context context, AttributeSet attrs) {super(context, attrs);}@Overridepublic boolean isFocused() {return true;}}
Hope to help you!