使用TextView实现跑马灯效果
来源:互联网 发布:微信多帐号登录软件 编辑:程序博客网 时间:2024/06/02 04:06
1、新建MarqueeTextView 继承自 TextView
import android.content.Context;import android.util.AttributeSet;import android.widget.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; }}
2、主布局文件xml代码
<com.leadingsoft.mbh.marqueetextview.MarqueeTextView android:id="@+id/tv1" android:layout_width="match_parent" android:layout_height="wrap_content" android:ellipsize="marquee" android:focusable="true" android:focusableInTouchMode="true" android:singleLine="true" android:marqueeRepeatLimit="1" android:scrollHorizontally="true" android:text="@string/tv1" /> <com.leadingsoft.mbh.marqueetextview.MarqueeTextView android:id="@+id/tv2" android:layout_width="match_parent" android:layout_height="wrap_content" android:ellipsize="marquee" android:focusable="true" android:focusableInTouchMode="true" android:singleLine="true" android:text="@string/tv2" />
阅读全文
0 0
- 使用TextView可以实现跑马灯效果
- 使用TextView实现跑马灯效果
- 使用TextView实现跑马灯效果
- 使用TextView实现跑马灯效果
- 使用TextView实现跑马灯效果
- 使用TextView实现跑马灯的效果
- 使用TextView实现跑马灯的效果
- 使用TextView实现跑马灯效果
- Android使用TextView实现跑马灯效果
- 使用TextView实现跑马灯效果
- Android使用TextView实现跑马灯效果
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- PHP与微信小程序的纠葛---2
- hdoj1014(输出格式)
- loadrunner之检查点——web_reg_find()函数
- Maven学习总结(21)——Maven坐标详解
- spydroid-ipcamera 实现Android视频实时上传到服务器,服务器可以实时浏览
- 使用TextView实现跑马灯效果
- android 架构模式
- DCL 文件浏览示例
- 【Java】Java实现批量打包文件Zip下载
- const char*, char const*, char*const的区别
- keil环境下stm32下载和擦除程序对Flash的影响
- Watchdog机制以及问题分析
- java对cookie的操作
- Android 热更新之tinker