ITeye博客

textView自动滑动

u010991855 · 2015-04-17 12:51 · android · 移动开发 · Markdown

今天一个功能需要用到textview滑动效果,在网上找了几个例子

整理一下,以备后用

<TextView
        android:id="@+id/textview"
        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:text=""
        android:textColor="@android:color/black" />

还需要在java类中添加一行
TextView textview = (TextView) findViewById(R.id.textview);
textview.setMovementMethod(ScrollingMovementMethod.getInstance());

评论(0)

暂无评论。

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