Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change part of text color within an "EditText" widget

I'm +- new to android and was wondering if it's possible to change only part of the text color in a EditText widget... Actually i'm making a notepad app where you would be able, for example, to write "bblablabal" and then click on the "yellow" button and keep writing in yellow color (the text written before doesn't have to change, as it does with the .setTextColor() method).

I've tried some of the java methods and also tried some workarounds with no succes... any ideas of how to makes this works ?

Thank you! Rodrigo.

like image 875
Rodrigo Manyari Avatar asked Jun 29 '11 17:06

Rodrigo Manyari


1 Answers

Yes, that's possible. Take a look at SpannbleStringBuilder.

More details: Android: Coloring part of a string using TextView.setText()?

like image 100
inazaruk Avatar answered Sep 23 '22 14:09

inazaruk