DaveJohnston
DaveJohnston

Reputation: 10151

Set text highlight colour of Blackberry RichTextField

Does anyone know how to set the background colour of just a section of text within a RichTextField on the Blackberry?

I already use the offsets, attributes and fonts arrays to make changes to the appearance of certain sections of the text, but I would like to add a highlight colour to the background of one section too.

I know there is a protected method called getBackgroundColors that returns an array of colors to be used, which I can overwrite. But I have tried this and that method never seems to get called in my code, I don't actually know how and when the underlying implementation of the RichTextField actually use this method. Any ideas?

Upvotes: 1

Views: 1141

Answers (3)

Ashraf Bashir
Ashraf Bashir

Reputation: 9804

It can't be done.

Upvotes: 0

DaveJohnston
DaveJohnston

Reputation: 10151

So basically, it can't be done is the answer.

Upvotes: 1

Prabhu R
Prabhu R

Reputation: 14222

You can extend the RichtextField and then in the paint method, you can paint the background and then call super.paint()

Upvotes: 1

Related Questions