2011-08-11 26 views

回答

0

只是使用Timer並相應地改變你的編輯文本的字體顏色和停止定時器焦點丟失。

0

我認爲你可以做這樣的事情:

斯普利特款的話使用方法:

split(String separator);// it will return an array of Strings 
//in your case you will do somthing like this 
myWords = paragraph.split(" ");// the separator is the space 

然後,你可以使用的方法來colorate你想要的那些什麼都通過使用該方法的話:

myNewParagraph.append(HTML.fromHtml("<font color...>... Your HTML Code to colorate your Text")); 

,當你完成着色每一個字,你更新的TextView來顯示彩色

01新文本

希望它有幫助

0

您可以使用跨度來控制文本的外觀。看看SpannableCharacterStyle

這裏是一個例子。當然你需要把它放在某種計時器中。

Spannable spannableText = getSpannableText(yourTextView); 
spannableText.setSpan(new TextAppearanceSpan(...), wordStart, wordEnd) 
yourTextView.setText(spannableText); 

private Spannable getSpannableText(TextView tv) { 
    CharSequence cs = tv.getText(); 
    if (cs instanceof Spannable) { 
    return (Spannable)cs; 
    } else { 
    return SpannableString.valueOf(cs); 
    } 
}