跑马灯效果
16lz
2021-12-04
一、效果图
二、实现代码:
<TextView android:layout_width="100px"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:ellipsize="marquee"
android:focusable="true"
android:marqueeRepeatLimit="marquee_forever"
android:focusableInTouchMode="true"
android:scrollHorizontally="true"
android:text="这才是真正的文字跑马灯效果"
>
</TextView>
代码说明:
a). 经测试与转载文章区别主要在于这里有设置android:focusableInTouchMode
b). 测试环境为Android1.5、模拟器。
二、实现代码:
<TextView android:layout_width="100px"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:ellipsize="marquee"
android:focusable="true"
android:marqueeRepeatLimit="marquee_forever"
android:focusableInTouchMode="true"
android:scrollHorizontally="true"
android:text="这才是真正的文字跑马灯效果"
>
</TextView>
代码说明:
a). 经测试与转载文章区别主要在于这里有设置android:focusableInTouchMode
b). 测试环境为Android1.5、模拟器。
更多相关文章
- Android(安卓)SDK Manager 更新失败的解决方法
- Android(安卓)密度转换实例
- android短信和彩信探秘threads
- Android开发——控件基础(七)ListView组件:示例代码
- Android应用程序安装过程源代码分析(3)
- Android组件学习笔记(连接互联网)
- Ubuntu 13.04 编译环境配置及android 2.3 源代码编译时出现了以
- Android实现圆形头像-使用自定义控件
- Android(安卓)源码 修改系统默认横屏