Android--跑马灯
来源:互联网 发布:苏30mkk和苏30mki知乎 编辑:程序博客网 时间:2024/06/06 06:30
Android--跑马灯
跑马灯的效果默认是需要获得焦点才有效。为了任何时候有效,可以继承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;
}
}
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.setSingleLine(true);
mText.setEllipsize(TruncateAt.MARQUEE);
mText.setMarqueeRepeatLimit(-1);
mText.setMarqueeRepeatLimit(-1);Ok了
下载:工程代码 http://up.2cto.com/2012/0105/20120105030021680.zip
- Android 跑马灯效果
- android跑马灯效果
- android跑马灯
- android跑马灯效果
- android 跑马灯
- android跑马灯文字效果
- Android 跑马灯
- android跑马灯实现
- Android跑马灯效果
- android 跑马灯实现
- Android 跑马灯效果
- android TextView跑马灯
- Android文字跑马灯
- android跑马灯效果
- Android 跑马灯
- Android TextView跑马灯
- android 跑马灯效果
- Android--最强跑马灯
- 【linux】sed 批量替换 tab替换为空格
- ubuntu自主配置ip地址
- CentOS 6.4 下 sync
- Codeforces 306C White, Black and White Again (简单计数)
- 音频,PCM裸流的一些扫盲记录
- Android--跑马灯
- Git 工作区、暂存区和版本库
- iOS 自动布局图片类似微博
- ListView适应ScrollView的效果
- 强连通分量 间谍网络
- visual studio中提示无法解析的外部符号的解决方案
- Oracle查看允许的最大连接数和当前连接数
- 设置UITextField的左边距
- PAT 乙级 1027. 打印沙漏