新聞中心
這篇文章給大家介紹 Android開發(fā)中通過使用TextView實(shí)現(xiàn)一個(gè)字體滾動(dòng)效果,內(nèi)容非常詳細(xì),感興趣的小伙伴們可以參考借鑒,希望對(duì)大家能有所幫助。
創(chuàng)新互聯(lián)建站,為您提供成都網(wǎng)站建設(shè)、重慶網(wǎng)站制作、網(wǎng)站營銷推廣、網(wǎng)站開發(fā)設(shè)計(jì),對(duì)服務(wù)砂巖浮雕等多個(gè)行業(yè)擁有豐富的網(wǎng)站建設(shè)及推廣經(jīng)驗(yàn)。創(chuàng)新互聯(lián)建站網(wǎng)站建設(shè)公司成立于2013年,提供專業(yè)網(wǎng)站制作報(bào)價(jià)服務(wù),我們深知市場的競爭激烈,認(rèn)真對(duì)待每位客戶,為客戶提供賞心悅目的作品。 與客戶共同發(fā)展進(jìn)步,是我們永遠(yuǎn)的責(zé)任!
Android TextView 字體滾動(dòng)效果
實(shí)例代碼:
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 XML:
關(guān)于 Android開發(fā)中通過使用TextView實(shí)現(xiàn)一個(gè)字體滾動(dòng)效果就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,可以學(xué)到更多知識(shí)。如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到。
當(dāng)前題目:Android開發(fā)中通過使用TextView實(shí)現(xiàn)一個(gè)字體滾動(dòng)效果
文章路徑:http://www.ef60e0e.cn/article/pdghds.html