当前位置: 移动技术网 > IT编程>移动开发>Android > Android TextView跑马灯效果实现方法

Android TextView跑马灯效果实现方法

2019年07月24日  | 移动技术网IT编程  | 我要评论

娃娃嫂子,任梦宣,tnt寒冰飞镖

本文实例讲述了android textview跑马灯效果实现方法。分享给大家供大家参考,具体如下:

public class mytextview extends textview{
  public mytextview(context context, attributeset attrs) {
    super(context, attrs);
    // todo auto-generated constructor stub
  }
  public mytextview(context context, attributeset attrs, int defstyle) {
    super(context, attrs, defstyle);
    // todo auto-generated constructor stub
  }
  public mytextview(context context) {
    super(context);
    // todo auto-generated constructor stub
  }
  @override
  public boolean isfocused() {
    // todo auto-generated method stub
    return true;   //must be return true;
  }
}

在xml文件中:

<packagename.mytextview android:id="@+id/my_textview"
android:layout_width="400px" android:layout_height="35px" 
android:singleline="true" android:ellipsize="marquee"
android:marqueerepeatlimit="marquee_forever" android:textsize="22sp"/>

更多关于android控件相关内容感兴趣的读者可查看本站专题:《android控件用法总结

希望本文所述对大家android程序设计有所帮助。

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网