如何在ListView中的TextView显示跑马灯效果

2025-03-25 11:44:58
推荐回答(1个)
回答1:

textview控件中添加如下属性可以实现跑马灯效果:
android:layout_height="wrap_parent"
android:marqueeRepeatLimit="1"//表示为滚动显示一次
android:singleLine="true" //表示单行显示
android:ellipsize="marquee" //表示滚动效果
android:focusableInTouchMode="true"
android:focusable="true"// 在控件获得Focus时才会显示走马灯效果