android 跑马灯速度,实现TextView跑马灯效果,如何控制文本滚动的速度?
layout文件android:layout_width="wrap_content"android:layout_height="wrap_content"android:singleLine="true"android:ellipsize="marquee"android:focusable="true"android:focusableInTouchMode="true"android:te
layout文件
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="@string/marquee"/>public class MarqueeTextView extends TextView {
public MarqueeTextView(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
public MarqueeTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// TODO Auto-generated constructor stub
}
public MarqueeTextView(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
}
//实现跑马灯特效的关键
@Override
public boolean isFocused() {
return true;
}
}
更多推荐
所有评论(0)