android TextView实现跑马灯效果
2017-06-28 14:26
337 查看
TextView自带了跑马灯功能,只要把它的ellipsize属性设置为marquee就可以了。但有个前提,就是TextView要处于被选中状态才能有效果,看到这,我们就很自然的自定义一个控件,写出以下代码
重写了isFocused方法,并进行判断,只有设置了marqueen属性的才保持选中状态,否则它就跟普通TextView一样。接下来就可以直接使用了,看下布局:
重写了isFocused方法,并进行判断,只有设置了marqueen属性的才保持选中状态,否则它就跟普通TextView一样。接下来就可以直接使用了,看下布局:
相关文章推荐
- android用TextView实现跑马灯效果
- android TextView实现实现跑马灯效果,并监听滚动完成动作。
- Android TextView属性及跑马灯效果的实现
- Android中TextView实现垂直滚动(轮换效果,非跑马灯)
- Android常用UI编程_TextView实现跑马灯效果
- TextView属性android:ellipsize实现跑马灯效果,TextView内容过长加省略号,点击显示全部内容
- Android之TextView内容实现跑马灯效果
- Android TextView实现跑马灯效果
- android TextView实现跑马灯效果
- Android实现多个跑马灯效果,多个文本框TextView的跑马灯
- android用TextView实现跑马灯效果
- Android实现多个TextView同时显示跑马灯效果
- android TextView的跑马灯效果的实现
- android TextView实现跑马灯效果
- Android开发 TextView实现跑马灯效果
- Android TextView实现跑马灯效果
- Android实现多个跑马灯效果,多个文本框TextView的跑马灯
- android在Gridview实现Textview跑马灯效果
- Android--TextView实现跑马灯效果
- android TextView不用获得焦点实现跑马灯效果 两种方法