/**
* 一直滚动的TextView[跑马灯效果]
*/
public class AlwaysMarqueeTextView extends TextView {
public AlwaysMarqueeTextView(Context context) {
super(context);
}
public AlwaysMarqueeTextView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public AlwaysMarqueeTextView(Context context, AttributeSet attrs,
int defStyle) {
super(context, attrs, defStyle);
}
@Override
public boolean isFocused() {
return true;
}
}
<com.xxx.view.AlwaysMarqueeTextView
android:id="@+id/xxx_tv01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerInParent="true"
android:ellipsize="marquee"
android:focusable="true"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
android:text="一直滚动的TextView[跑马灯效果]"
android:textColor="@color/black" />
分享到:
相关推荐
一个垂直滚动TextView跑马灯效果的Demo,效果很棒
android三种方式实现TextView跑马灯效果
textview跑马灯效果,文字滚动效果
textview跑马灯效果终极实验,解决你对实现效果的疑问,viewgroup嵌套对跑马灯效果是否有影响,为什么有时候同样的设置对textview1起作用,对textview2不起3作用。
本代码,实现TextView的文字滚动播放效果,跑马灯特效,构成简约实用,感觉好点赞
android垂直滚动的textview,仿跑马灯效果
textview显示跑马灯效果,使用的是继承的方法onDraw不停地绘制 优点: 1.文字长短不限哦 2.不用非得获取焦点哦
自定义View—实现滚动TextView(跑马灯)效果源码,教程在http://blog.csdn.net/u012933743/article/details/46310225 如有不懂 可以评论提问
遇到一行文字过长不能全部显示时,需要滚动显示,可下载此代码,研究跑马灯效果的实现方法。
TextView滚动,跑马灯效果终极解决方案.rar,太多无法一一验证是否可用,程序如果跑不起来需要自调,部分代码功能进行参考学习。
主要为大家详细介绍了Android自定义textview实现竖直滚动跑马灯效果,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
TextView跑马灯效果,文字长度达不到屏幕宽度也可以。
本例使用两种方法实现android中TextView跑马灯(循环滚动)的效果
移动字幕,滚动textview,实现文字平移。跑马灯效果,可变换各种风格