Android TextView跑马灯效果实现方法
本文实例讲述了AndroidTextView跑马灯效果实现方法。分享给大家供大家参考,具体如下:
publicclassMyTextViewextendsTextView{
publicMyTextView(Contextcontext,AttributeSetattrs){
super(context,attrs);
//TODOAuto-generatedconstructorstub
}
publicMyTextView(Contextcontext,AttributeSetattrs,intdefStyle){
super(context,attrs,defStyle);
//TODOAuto-generatedconstructorstub
}
publicMyTextView(Contextcontext){
super(context);
//TODOAuto-generatedconstructorstub
}
@Override
publicbooleanisFocused(){
//TODOAuto-generatedmethodstub
returntrue;//mustbereturntrue;
}
}
在xml文件中:
<packagename.MyTextViewandroid: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程序设计有所帮助。
热门推荐
10 祝女儿简短祝福语大全
11 大学新年祝福语简短创意
12 元旦适合的祝福语简短
13 朋友出远门祝福语简短
14 初六简短的祝福语
15 祝男孩生日祝福语简短
16 同事调离的祝福语简短
17 拜年红包的祝福语简短
18 妈妈生日祝福语简短励志