android 跑马灯效果

<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); 

适用于任何情况,包括不在顶层容器上显示

猜你喜欢

转载自jianweicao.iteye.com/blog/1735446
今日推荐