Android TextView跑马灯效果(转)
来源:互联网 发布:珍宝岛冲突 知乎 编辑:程序博客网 时间:2024/05/20 22:39
转自http://blog.163.com/lingliu_08@126/blog/static/120384450201141102533229/
在Android的ApiDemo中,有Button的走马灯效果,但是换作是TextView,还是有一点差异。
结合Android API和网络一些Android牛人的研究成果,我在这里再啰嗦一下,希望对Android新手有所帮助。
定义走马灯(Marquee),主要在布局文件即可
<TextView
关键点:
(2)ellipsize 即申明使用走马灯marquee
(3)singleLine表示单行显示
(4)marqueeRepeatLimit表示走马灯显示的次数:marquee_forever-无限制不间断显示
补充其他博文里看到的
(5)有些情况是想TextView里的文字一直滚动,就要让该控件获取焦点,采取方法是重写已下三个方法
public ScrollAlwaysTextView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) { if (focused) super.onFocusChanged(focused, direction, previouslyFocusedRect); } @Override public void onWindowFocusChanged(boolean focused) { if (focused) super.onWindowFocusChanged(focused); }
- Android TextView跑马灯效果(转)
- Android TextView跑马灯效果
- Android TextView跑马灯效果
- Android TextView跑马灯效果
- Android TextView跑马灯效果
- [Android]TextView跑马灯效果
- Android textView 跑马灯效果
- android TextView 跑马灯效果
- Android TextView跑马灯效果
- Android TextView跑马灯效果
- Android TextView跑马灯效果
- android TextView跑马灯效果
- android TextView跑马灯效果
- Android TextView跑马灯效果
- Android TextView跑马灯效果
- android textView跑马灯效果
- Android TextView 跑马灯效果
- Android TextView跑马灯效果
- acm Sheep Frenzy(状态压缩+BFS)
- android 实现应用起动界面上有一层透明的功能指导界面
- iphone开源项目list
- Just For Fun Linus Torvalds 自传摘录
- 开讲 n...day
- Android TextView跑马灯效果(转)
- Git简介
- 流年,经不起怀念
- android自定义Activity窗体大小
- 基于S3C2440的bootloader详细分析
- Linux sendmail发送邮件
- android 关于自定义Theme
- c# 与 js 的交互(MSScriptControl)
- ARC的使用的问题