实现跑马灯效果的TextView

来源:互联网 发布:上海萌动网络 编辑:程序博客网 时间:2024/06/05 20:13

简单说下什么是跑马灯,就是类似于web一样,有一行字一直循环滚滚动这样,好吧还是看看实现效果图,一看就懂的了~

实现效果图:

代码实现:

<TextView        android:id="@+id/txtOne"        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:textSize="18sp"        android:singleLine="true"        android:ellipsize="marquee"        android:marqueeRepeatLimit="marquee_forever"        android:focusable="true"        android:focusableInTouchMode="true"        android:text="你整天说着日了狗日了狗,但是你却没有来,呵呵呵呵呵呵呵呵呵呵~"/>