package com.wpc.library.widget;
|
|
import android.content.Context;
|
import android.util.AttributeSet;
|
import android.widget.TextView;
|
|
/**
|
* 一个页面实现多个跑马灯效果
|
* Created by weikou2015 on 2018/10/18.
|
*/
|
|
public class MarqueeText extends TextView {
|
public MarqueeText(Context context) {
|
super(context);
|
}
|
|
public MarqueeText(Context context, AttributeSet attrs) {
|
super(context, attrs);
|
}
|
|
public MarqueeText(Context context, AttributeSet attrs, int defStyleAttr) {
|
super(context, attrs, defStyleAttr);
|
}
|
|
//TextView默认设置是第一个获取到的光标,
|
//如果想让所有的TextView都有跑马灯效果,则让所有的TextView都获取到光标就行了
|
//这里return true 就是让所有的TextView都获取到光标
|
@Override
|
public boolean isFocused() {
|
return true;
|
}
|
}
|