`
xm0ff255
  • 浏览: 15018 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

一直滚动的TextView[跑马灯效果]

阅读更多

 

/**
 * 一直滚动的TextView[跑马灯效果]
 */
public class AlwaysMarqueeTextView extends TextView {

	public AlwaysMarqueeTextView(Context context) {
		super(context);
	}

	public AlwaysMarqueeTextView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public AlwaysMarqueeTextView(Context context, AttributeSet attrs,
			int defStyle) {
		super(context, attrs, defStyle);
	}

	@Override
	public boolean isFocused() {
		return true;
	}
}


    <com.xxx.view.AlwaysMarqueeTextView
                    android:id="@+id/xxx_tv01"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_centerInParent="true"
                    android:ellipsize="marquee"
                    android:focusable="true"
                    android:marqueeRepeatLimit="marquee_forever"
                    android:singleLine="true"
                    android:text="一直滚动的TextView[跑马灯效果]"
                    android:textColor="@color/black" />
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics