Android实现文字显示跑马灯效果
来源:互联网 发布:c语言中的注释 编辑:程序博客网 时间:2024/04/30 13:50
(1)单个TextView实现跑马灯效果
<TextView android:id="@+id/text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:ellipsize="marquee" android:focusable="true" android:focusableInTouchMode="true" android:text="@string/textContent" />
</pre><pre name="code" class="html">其中 <string name="textContent">不过,他想,我的钓线深度很精确,只不过是我走运而已。可是谁知道呢?也许就在今天呢。每一天都是个崭新的日子。走运固然不错,不过我宁可保持精确。那样,机会来临时,你已经做好了准备。但是人不是为打败而生的,一个人可以被毁灭,却不能被打败。----《老人与海》</string>
自定义一个类MarqueeText
package com.******.marqueetextview;import android.content.Context;import android.util.AttributeSet;import android.widget.TextView;public class MarqueeText extends TextView {public MarqueeText(Context context, AttributeSet attrs, int defStyle) {super(context, attrs, defStyle);// TODO Auto-generated constructor stub}public MarqueeText(Context context, AttributeSet attrs) {super(context, attrs);// TODO Auto-generated constructor stub}public MarqueeText(Context context) {super(context);// TODO Auto-generated constructor stub}@Override<strong>public boolean isFocused() {// TODO Auto-generated method stubreturn true;}</strong>}
<com.******.marqueetextview.MarqueeText android:id="@+id/text5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:ellipsize="marquee" android:focusable="true" android:focusableInTouchMode="true" android:text="@string/textContent" />
0 0
- Android实现文字显示跑马灯效果
- Android 文字跑马灯效果
- Android 文字跑马灯效果
- android 文字跑马灯效果
- Android重写TextView实现文字跑马灯效果
- 一分钟实现 Android textview 跑马灯文字滚动效果
- android 实现循环播放的文字跑马灯效果
- android使用TextView实现文字的跑马灯效果
- Android中继承TextView实现文字的跑马灯效果
- 实现文字的跑马灯效果,Textview
- 标题文字跑马灯效果实现
- 【Android】跑马灯效果(文字滚动)
- android中文字跑马灯效果
- android 文字的跑马灯效果
- --------------------【Android】跑马灯效果(文字滚动)
- android 文字的跑马灯效果
- 文字跑马灯效果
- 文字 跑马灯 效果
- AudioRecorder 录音及播放,音量的获取。
- i os 定位服务
- 颜色和光照
- 第11周上机实践项目5——当年第几天
- Cflow使用详解
- Android实现文字显示跑马灯效果
- RMQ (Range Minimum/Maximum Query)算法
- SQLite 封装
- android PopupWindow空指针异常问题 低版本的小细节
- c++ 字符串流 sstream(常用于格式转换)
- attempt to dereference a generic a pointer
- 8个让程序员追悔莫及的职业建议
- makfile简单书写
- JS~字符串长度判断,超出进行自动截取(支持中文)