网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

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实现一个字体滚动效果
文章源于:http://bjjierui.cn/article/pdghds.html

其他资讯