您的位置:首页 > 移动开发 > Android开发

Android中TextView实现文字跑马灯效果(滚动轮播)

2017-03-15 22:26 1231 查看
效果图:



给TextView设置一些属性即可实现跑马灯的效果

<!--android:ellipsize="":定义跑马灯的效果,
android:focusable="":聚焦功能
android:focusableInTouchMode="":在触屏手机,获取焦点
android:marqueeRepeatLimit="marquee_forever":字体永远滚动
android:singleLine="true":单行显示-->
<TextView
android:id="@+id/show_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
android:textSize="20dp"/>


完整Demo代码下载:http://pan.baidu.com/s/1boTwtx9
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: