Marquee Effect
Layout code
<!--android:ellipsize Set the text too long, how is the control displayed?
start-ellipses appear at the beginning end-ellipses appear at the end middle-ellipses appear in the middle
The marquee-is displayed in the form of a marquee--
<!--running countless times--
android:marqueerepeatlimit= "Marquee_forever"
< get focus when!--touch--
Android:focuseabletouchmode= "true"
<!--make the text line display--
Android:singleline= "true"
<!--call the method in Mytextview with the package name--
<!--android:layout_below= "@+id/textview" puts the bottom of the component under the component of the given ID (PS: Place the current component below the given ID component)-
<!--android:layout_above= "@+id/textview" puts the bottom of the component above the component of the given ID (PS: Place the current component above the given ID component)-
<
Cn.androidstudy.pmd.MyTextView
Android:id= "@+id/textview"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:singleline= "true"
Android:ellipsize= "Marquee"
Android:focusableintouchmode= "true"
Android:focusable= "true"
android:text= "@string/hello_world"/>
<cn.androidstudy.pmd.mytextview
Android:id= "@+id/textview1"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:singleline= "true"
Android:ellipsize= "Marquee"
Android:focusableintouchmode= "true"
Android:focusable= "true"
android:layout_below= "@+id/textview"
android:text= "@string/hello_world"/>
<cn.androidstudy.pmd.mytextview
Android:id= "@+id/textview2"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:singleline= "true"
Android:ellipsize= "Marquee"
Android:focusableintouchmode= "true"
Android:focusable= "true"
android:layout_below= "@+id/textview1"
android:text= "@string/hello_world"/>
Multiple marquee class files
Package CN.ANDROIDSTUDY.PMD;
Import Android.content.Context;
Import Android.util.AttributeSet;
Import Android.widget.TextView;
public class Mytextview extends textview{
Public Mytextview (Context context) {
Super (context); TODO auto-generated Constructor stub}
Public Mytextview (context context, AttributeSet attrs, int defstyle) {
Super (context, attrs, Defstyle); TODO auto-generated Constructor stub}
Public Mytextview (context context, AttributeSet Attrs) {
Super (context, attrs); TODO auto-generated Constructor stub}
public Boolean isFocused () {
return true; } }
Android Racing Lights