ITeye博客

TextView跑马灯效果

KT.G · 2015-01-04 17:28 · 随笔随记 · 移动开发 · 跑马灯 · Markdown

 <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>

  代码说明:

  1)设置android:focusableInTouchMode 设置跑马灯效果

   2)android:scrollHorizontally="true" 设置横向滑动

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。