Android TextView跑馬燈效果實現(xiàn)方法
本文實例講述了Android TextView跑馬燈效果實現(xiàn)方法。分享給大家供大家參考,具體如下:
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"/>
更多關(guān)于Android控件相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《Android控件用法總結(jié)》
希望本文所述對大家Android程序設(shè)計有所幫助。
- Android TextView實現(xiàn)跑馬燈效果的方法
- Android 中TextView中跑馬燈效果的實現(xiàn)方法
- Android 實現(xiàn)不依賴焦點和選中的TextView跑馬燈
- Android基于TextView不獲取焦點實現(xiàn)跑馬燈效果
- Android中使用TextView實現(xiàn)文字跑馬燈效果
- Android基于TextView屬性android:ellipsize實現(xiàn)跑馬燈效果的方法
- Android基于TextView實現(xiàn)的跑馬燈效果實例
- Android自定義textview實現(xiàn)豎直滾動跑馬燈效果
- Android使用TextView跑馬燈效果
- Android自定義控件ViewFipper實現(xiàn)豎直跑馬燈效果
相關(guān)文章
android 判斷網(wǎng)絡(luò)是否可用與連接的網(wǎng)絡(luò)是否能上網(wǎng)
下面小編就為大家分享一篇android 判斷網(wǎng)絡(luò)是否可用與連接的網(wǎng)絡(luò)是否能上網(wǎng),具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-01-01Kotlin 協(xié)程與掛起函數(shù)及suspend關(guān)鍵字深入理解
這篇文章主要為大家介紹了Kotlin 協(xié)程與掛起函數(shù)及suspend關(guān)鍵字深入理解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2022-12-12Android編程之手機壁紙WallPaper設(shè)置方法示例
這篇文章主要介紹了Android編程之手機壁紙WallPaper設(shè)置方法,結(jié)合實例形式分析了Android手機壁紙WallPaper的相關(guān)設(shè)置與使用技巧,需要的朋友可以參考下2017-08-08Android開發(fā)實現(xiàn)在Wifi下獲取本地IP地址的方法
這篇文章主要介紹了Android開發(fā)實現(xiàn)在Wifi下獲取本地IP地址的方法,涉及Android編程Wifi的調(diào)用及IP地址的獲取與轉(zhuǎn)換相關(guān)操作技巧,需要的朋友可以參考下2017-09-09