Custom TextView class;
Package Com.yunkun.textview;import Android.content.context;import android.util.attributeset;import Android.widget.TextView; Public classMytextview extends textview{ PublicMytextview (Context context, AttributeSet Attrs) {Super (context, attrs); //TODO auto-generated Constructor stub } //always returns true, which always gets the focus@Override PublicBoolean isFocused () {return true; }}
The XML layout inside;
<Com.yunkun.textView.MyTextView Android:id="@+id/f2_textview_wenzi"Android:layout_width="wrap_content"Android:layout_height="wrap_content"android:ellipsize="Marquee"android:focusable="true"Android:focusableintouchmode="true"Android:marqueerepeatlimit="Marquee_forever"Android:singleline="true"Android:text="errands help us solve our life problems quickly. Each of us can become a single person, can also become a bill, to the convenience of people can also earn a small amount of extra money! "Android:textcolor="#0f0"android:textsize="40px"/>
TextView realization of the effect of the marquee lamp