自定义控件Ui×××灯形式

import android.content.Context;

import android.util.AttributeSet;

import android.widget.TextView;

public class UiTextView extends TextView {

public UiTextView(Context context, AttributeSet attrs, int defStyle) {

super(context, attrs, defStyle);

// TODO Auto-generated constructor stub

}

public UiTextView(Context context, AttributeSet attrs) {

super(context, attrs);

// TODO Auto-generated constructor stub

}

public UiTextView(Context context) {

super(context);

// TODO Auto-generated constructor stub

}

@Override

public boolean isFocused() {

// TODO Auto-generated method stub

return true;

}

}

布局

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:tools="http://schemas.android.com/tools"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

 >

    <com.eduask.demo3.ui.UiTextView        //此为包名

        android:marqueeRepeatLimit="marquee_forever"

        android:ellipsize="marquee"

        android:layout_width="fill_parent"

        android:layout_height="wrap_content"

        android:singleLine="true"

        android:text="此为×××灯显示内容!!!"

        />

    

</RelativeLayout>