<TextView android:id="@+id/app_loc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000"
android:textSize="12dp"
android:layout_marginLeft="10dip"
android:singleLine="true"
android:focusableInTouchMode="true"
android:ellipsize="marquee"
android:scrollHorizontally="true"
android:marqueeRepeatLimit="marquee_forever"></TextView>
如果想不获取焦点就让TextView 的跑马灯效果 直接在自定义adapter中setView方法找到 该TextView 并设置 成 convertView.findViewById(R.id.app_loc).setSelected(true);
适用于任何情况,包括不在顶层容器上显示
本文介绍了一种在不获取焦点的情况下实现TextView跑马灯效果的方法。通过在自定义adapter的setView方法中找到对应的TextView并设置其为选中状态,可以轻松启用跑马灯滚动。这种方法适用于多种布局场景。
3万+

被折叠的 条评论
为什么被折叠?



