Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change color of specific text only in text box of BlackBerry

How to change color of specific text only in textbox for Blackberry applications?

like image 447
iOSDev Avatar asked Dec 10 '22 20:12

iOSDev


1 Answers

Unfortunately the answer is roll your own - there's no editable text field control that lets you change the font color at all. @Mark Novakowski's answer is a standard way of working around that, but will change all the text to one color.

If you're not worried about supporting the Pearl-style SureType keyboard, then you can override keyChar on ActiveRichTextField and manually add characters to the text in ActiveRichTextField.

For SureType fields, the answer is even worse - you don't have low level access to the SureType APIs (for correctly dealing with the predictive text popup) for non-qwerty phones (the Pearl series) so you have to resort to some real trickery to get a fully custom text field to function correctly on those devices. It may come down to having to have multiple EditFields arranged in a manager, with e.g. one EditField overridden to show read (as in Marks' answer). The trick there will be dynamically creating and adding text fields as necessary.

Yes, sometimes the RIM API makes easy things easy, and hard things nearly impossible.

like image 118
Anthony Rizk Avatar answered Apr 22 '23 21:04

Anthony Rizk