D
D
Daniel Khaliulin2016-01-05 15:43:57
Android
Daniel Khaliulin, 2016-01-05 15:43:57

How to preserve spaces between characters when using Html.fromHtml()?

Context:
mobile application with songs and chords for singing along with the guitar.
Task:
It is necessary that the chords are indicated above the words in the text of the song. Chords should be in bold . In this case, the chords should be located above those parts of the text where the transition to this particular chord is necessary - this task is implemented by placing spaces between the chords above the text of the song itself.
Problem:
If I use the Html.fromHtml(mydata), (where mydata is html formatted) method to highlight the chords themselves, the spaces between the chords are slid off and displayed as if there were no spaces between them.
Added screenshots for clarity.
5c2ecbaa5b394cd7a88ab14601c8a310bf46e142bde74bc49ff38580806fdc7f

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2016-01-05
@khaliulin

Non-breaking space?
 

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question