Android 跑马灯
来源:互联网 发布:微星电池校正软件 编辑:程序博客网 时间:2024/05/01 22:26
现在的人抄袭成风啊,都不带大脑思考的。
跑马灯的效果,我看到好多文章就想笑。很多文章都有一句,文字不能比TextView长。我了个去,有点脑子的都知道,文字没有TextView长的话还需要跑马吗?全显示出来了还需要跑马?
跑马灯的效果默认是需要获得焦点才有效。为了任何时候有效,可以继承Textiew,重写IsFocused方法,返回true。
public class MarqueeTextView extends TextView {public MarqueeTextView(Context context) {super(context);}public MarqueeTextView(Context context, AttributeSet attrs){super(context,attrs);}public MarqueeTextView(Context context, AttributeSet attrs, int defStyle){super(context, attrs, defStyle);}public boolean isFocused(){return true;}}
然后TextView配置属性
mText.setSingleLine(true);mText.setEllipsize(TruncateAt.MARQUEE);
mText.setMarqueeRepeatLimit(-1);Ok了
下载:工程代码
- Android 跑马灯效果
- android跑马灯效果
- android跑马灯
- android跑马灯效果
- android 跑马灯
- android跑马灯文字效果
- Android 跑马灯
- android跑马灯实现
- Android跑马灯效果
- android 跑马灯实现
- Android 跑马灯效果
- android TextView跑马灯
- Android文字跑马灯
- android跑马灯效果
- Android 跑马灯
- Android TextView跑马灯
- android 跑马灯效果
- Android--最强跑马灯
- 在二叉树中找出和为某一值的所有路径
- Android 网站资源收集大全
- 7个改变世界的Java项目
- 接口后台调用方法
- 从CSDN账户密码被盗说起
- Android 跑马灯
- 改变世界的几个java项目
- 23种设计模式的索引
- iOS开发知识要点
- 性能测试结果分析
- 移植u-boot-2009.08到mini2440(二)板级设置
- 国内外DNS服务器地址列表—不保证全部可用,可以多试
- Telnet简介~
- opencv 错误