1. 程式人生 > >adnroid textview設定文字橫向自動滾動(跑馬燈效果)

adnroid textview設定文字橫向自動滾動(跑馬燈效果)

關於textview設定文字橫向自動滾動(跑馬燈效果)文章,雖然網上有,但我看了下,描述的正確的只有一篇,因為我覺得自己再寫一篇,方便自己和大家以後方便使用

先上效果圖:


程式碼如下:

   <TextView
                android:id="@+id/tv_table_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:singleLine="true"
                android:focusable="true"
                android:focusableInTouchMode="true"
                android:text="就算對方角度來看積分卡撒嬌福克斯的繳費基數大幅減少貸款房價跌幅擴大解放打算開發建設的方式登記方式的開發建設貸款的司法鑑定收費的"
                android:textColor="#FFFFFF"
                android:marqueeRepeatLimit="marquee_forever"
                android:ellipsize="marquee"
                android:textSize="@dimen/sp18"
                android:textStyle="bold" />