Applying style to perticuler character in textview.

Posted by HellBoy on Stack Overflow See other posts from Stack Overflow or by HellBoy
Published on 2011-01-15T06:49:42Z Indexed on 2011/01/15 6:53 UTC
Read the original article Hit count: 181

Filed under:

Currently I am using 26 Textview so that I can apply style to particular character depending on runtime situation. But if I can able to apply style on particular character in textview I can achieve my goal using only one textview.

e.g. If I want to make character 'M' red in following code. Is it possible to achieve this?

    <TextView 
    android:id="@+id/TextView01" 
    android:layout_height="wrap_content" 
    android:textSize="20dip" 
    android:textStyle="bold"
    android:layout_width="15dip" 
    android:text="ABCDEFGHIJKLMNOPQRSTUVWXYZ" 
    android:background="#FFFFFF" 
   android:textColor="#000000"/>`

Or anybody have better option than using 26 TextView it also welcome.

© Stack Overflow or respective owner

Related posts about android