TextView实现跑马灯
来源:互联网 发布:网络逃犯坐火车 编辑:程序博客网 时间:2024/05/02 02:12
<TextView
android:text="@string/ch_hello"
android:id="@+id/TextView01"
android:layout_width="320px"
android:layout_height="wrap_content"
android:textColor="@color/blue"
android:ellipsize="marquee"
android:focusable="true"
android:marqueeRepeatLimit="marquee_forever"
android:focusableInTouchMode="true"
android:scrollHorizontally="true"
style="@style/big_font"
/>
这种方法实现的跑马灯只有在当前TextView处于焦点状态才有效果,因此可用于一些字符串比较长的焦点显示项;
android:focusableInTouchMode="true" 是关键语句,
横向字符串要比android:layout_width宽,否则现有的宽度就能完全显示字符串,也就不需要滚动显示了;
android:ellipsize 的value有:“start”字符串开头显示省略号;
“middle”字符串中间显示省略号;
“end”字符串结尾显示省略号;
“marquee”字符串跑马灯显示;
android:id="@+id/TextView01" //为TextView添加一个ID标识,便于Java代码通过R类来访问该TextView;
- TextView实现跑马灯
- TextView实现跑马灯
- TextView实现跑马灯
- TextView实现跑马灯
- TextView实现跑马灯
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- android--TextView实现跑马灯
- TextView跑马灯的实现
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- textview实现跑马灯效果
- TextView实现跑马灯效果
- C++下this指针实现机制分析(针对vc++ 6.0)
- 关于解决zencart乱码的措施
- Java中的JDBC常用的连接字符串
- IBM Rational Insight V1.0 简介---转载
- qq一面
- TextView实现跑马灯
- Lua安装与使用
- 遍历文件夹并建成目录树
- Table of CGI variable names
- 堆和栈的区别 (转贴)
- c文件操作
- 关于日期函数的一些整理
- 2012高校宣讲会信息
- 19款Javascript富文本编辑器