不用获得焦点也能实现跑马灯效果的textView

/**
 * 这是一个不用获得焦点也能实现跑马灯效果的textView
 * @author Chenzt
 *
 */
public class MarqueeTextView extends TextView {
	public MarqueeTextView(Context con) {
		super(con);
	}

	public MarqueeTextView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public MarqueeTextView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
	}

	@Override
	public boolean isFocused() {
		return true;
	}

	@Override
	protected void onFocusChanged(boolean focused, int direction,
			Rect previouslyFocusedRect) {
	}
}


你可能感兴趣的:(textview)