Android开发中通过使用TextView实现一个字体滚动效果-创新互联

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

创新互联建站专注于企业网络营销推广、网站重做改版、虎林网站定制设计、自适应品牌网站建设、H5响应式网站商城建设、集团公司官网建设、成都外贸网站建设、高端网站制作、响应式网页设计等建站业务,价格优惠性价比高,为虎林等各大城市提供网站开发制作服务。

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开发中通过使用TextView实现一个字体滚动效果-创新互联
本文网址:http://www.csruizhi.cn/article/ccsdse.html

其他资讯

Copyright © 2007-2024 成都优众联杰科技有限公司 All Rights Reserved 蜀ICP备2024116266号
友情链接: 重庆企业网站建设 企业网站设计 成都商城网站建设 成都网站建设公司 重庆网站建设 营销网站建设 营销型网站建设 成都网站建设公司 网站建设费用 手机网站制作 成都h5网站建设 网站建设 成都网站建设 网站设计 成都网站建设 网站设计制作报价 成都企业网站建设公司 网站制作公司 企业网站设计 网站设计制作 手机网站制作设计 重庆企业网站建设