娃娃嫂子,任梦宣,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程序设计有所帮助。
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Android studio 解决logcat无过滤工具栏的操作
Android Studio 恢复小窗口停靠模式(Docked Mode)
Android studio保存logcat日志到本地的操作
Android Studio快捷键生成TAG、Log.x日志输出介绍
网友评论