0

I'm new to android and would like to know how to change the color of a specific word inside a strings.xml file I'm trying to write a song and I needed the notes to have another color and the chorus to be bold

<string name="homem_novo_seras_acordes">
        mi- \t\t\t\t\t\t\t\t\t\t\t\t\t\t re\
        Um Homem Novo vai nascer\
        do \t\t\t\t sol \t\t\t\t\t\t\t\t mi-\
        Neste dia onde tudo vai mudar\
        si-\
        Tens um mundo pra transformar\
</string>

Thanks

2
  • why not just change it on activity? attention this link stackoverflow.com/questions/5286275/… Commented Jan 25, 2020 at 14:28
  • 1
    Please include the physical code as opposed to a screenshot of it on StackOverflow, this is much more useful for those who want to try helping and thereby for you as well. Surround your code block with ``` on either side for it to render as a code sample in your post. Commented Jan 25, 2020 at 14:59

1 Answer 1

1

It's simple, you can achieve multicolor text using a Spannable string.

To know more how to do it, check this developer blog https://medium.com/androiddevelopers/spantastic-text-styling-with-spans-17b0c16b4568

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.