android TextView單行跑馬燈設定
在textview加入以下
如果更新view的內容會造成跑馬燈的textview重繪。導致跑馬燈停下,
這個時候可以在textview外套用一個linearlayout,就可以解決。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android:ellipsize="marquee" | |
android:singleLine="true" | |
android:focusable="true" 該textView適中獲取焦點,只有獲取焦點才能實現跑馬燈效果,當然嘍如果是多個TextView列表需要把這個屬性去掉才能實現點選那個view那個view跑 | |
android:marqueeRepeatLimit="marquee_forever" | |
android:focusableInTouchMode="true" |
這個時候可以在textview外套用一個linearlayout,就可以解決。
留言
張貼留言