跑馬燈(橫向滾動)
阿新 • • 發佈:2018-12-15
<TextView android:id="@+id/tv_text" android:layout_width="match_parent" android:layout_height="wrap_content" android:ellipsize="marquee" android:focusable="true" android:focusableInTouchMode="true" android:marqueeRepeatLimit="marquee_forever" android:singleLine="true" android:textSize="28sp" android:text="路漫漫其修遠兮,吾將上下而求索3w3erweqrwqreqwreqwerwqrwrq" android:textColor="#00ff00" android:scrollHorizontally="true"/> //設定為跑馬燈顯示 android:ellipsize="marquee" //獲取焦點 android:focusable="true" //可以通過toucth來獲得focus android:focusableInTouchMode="true" //設定重複的次數 android:marqueeRepeatLimit="marquee_forever" //單行顯示文字 android:singleLine="true"