Android开发中通过使用TextView实现一个字体滚动效果
这篇文章给大家介绍 Android开发中通过使用TextView实现一个字体滚动效果,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。

创新互联建站,为您提供成都网站建设、重庆网站制作、网站营销推广、网站开发设计,对服务砂岩浮雕等多个行业拥有丰富的网站建设及推广经验。创新互联建站网站建设公司成立于2013年,提供专业网站制作报价服务,我们深知市场的竞争激烈,认真对待每位客户,为客户提供赏心悦目的作品。 与客户共同发展进步,是我们永远的责任!
Android TextView 字体滚动效果
实例代码:
package com.godinsec.seland.ui.tools;
import android.content.Context;
import android.text.TextUtils.TruncateAt;
import android.util.AttributeSet;
import android.widget.TextView;
public class MarqueTextView extends TextView {
public MarqueTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(context);
}
public MarqueTextView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
public MarqueTextView(Context context) {
super(context);
init(context);
}
private void init(Context context) {
setEllipsize(TruncateAt.MARQUEE) ;
}
@Override
public boolean isFocused() {
return true;
}
}
Android XML:
关于 Android开发中通过使用TextView实现一个字体滚动效果就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。
标题名称:Android开发中通过使用TextView实现一个字体滚动效果
URL网址:http://www.jxjierui.cn/article/pdghds.html


咨询
建站咨询
