TextView自定义跑马灯效果
来源:互联网 发布:淘宝评分怎么提高 编辑:程序博客网 时间:2024/04/29 11:57
在复杂的布局中想要使用跑马灯效果需要自己自定义TextView,因为有可能在复杂的布局中原来的TextView获取不到焦点,就不会有效果
解决方法:
自己重写TextView:
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 defStyleAttr) { super(context, attrs, defStyleAttr); } @Override public boolean isFocused() { return true; }}
<***.MarqueeTextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="12dp" android:paddingLeft="12dp" android:paddingRight="12dp" android:text="234254fadfadffadfadfgfhdgfhjhfjhfjhjfhjfhjfhjfhjtyteytryetaaaa" android:marqueeRepeatLimit="marquee_forever" android:scrollHorizontally="true" android:singleLine="true" android:textColor="@color/white" android:ellipsize="marquee" android:focusableInTouchMode="true" android:focusable="true" />
0 0
- TextView自定义跑马灯效果
- 自定义TextView跑马灯效果
- 自定义TextView实现跑马灯效果
- 自定义TextView实现跑马灯效果
- 自定义TextView跑马灯效果实例教程
- TextView跑马灯效果-自定义控件
- 自定义TextView实现跑马灯效果
- android 自定义textview跑马灯效果
- 自定义TextView实现跑马灯效果
- Android自定义TextView实现跑马灯效果
- Android 自定义textview实现跑马灯效果
- TextView跑马灯效果
- TextView跑马灯效果
- TextView跑马灯效果
- TextView跑马灯效果
- TextView跑马灯效果
- TextView跑马灯效果
- TextView 跑马灯效果
- Eclipse导出javadoc文档
- Swift - 条件语句和循环语句
- Sublime Text 如何连接 FTP/SFTP ——图文详细教程
- 浅谈Java中的hashcode方法
- Java多线程编程核心技术笔记
- TextView自定义跑马灯效果
- 友元函数
- 数据库设计原则(转载)
- css-float,clear
- 模式设计--装饰模式
- JVM的内存区域划分
- IO与文件笔记
- Exchange server 2010手动白名单设置
- linux centos 简单安装vsftpd 服务及配置卸载