BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-15-2010, 06:18 AM   #1 (permalink)
New Member
 
Join Date: Mar 2010
Model: 7100t
PIN: N/A
Carrier: dnt no
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Diffrent text colour in same string

Please Login to Remove!

Hi I have a string of text which will be constantly changing since It downloads every time you start the app, but that is not the problem I just want you to know the situation.

Know the string holds a series of information in the same format such as name, date, status etc. So how do I change the colour of only one part of the string and use a different colour for other parts. I will oly need three colours.

I don't think that creating three text fields with diffrent colous will help, as the string neds to be rendered in the order it is in.

I thought perhaps finding a key value in the string such as a word which I can do between each part of the series, and then creating a new rich text field whith an asigned colour depending on a value in the string? However I do not know how to do that.

Please help, thanks.
Offline  
Old 03-15-2010, 10:09 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2010
Model: N/A
PIN: N/A
Carrier: Fledge
Posts: 43
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think you are looking for advice on basic string parsing functions. Look at the String functions "substring" and "indexOf" at API Reference: String Class which can be used to find the position of text in a string and create a new string based on the starting and ending position parameters.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

MAIN BOARD ALTAIR-60 R1.03G 08G11012113*SI ALTAIR 60 R103G Expedited shipping
$229.0
MAIN BOARD ALTAIR-60 R1.03G 08G11012113*SI ALTAIR 60 R103G Expedited shipping pictureMulti-Gas Detector MSA 10107602 ALTAIR 4X W/Charcoal Case LEL O2 CO H2S New
$450.0
Multi-Gas Detector MSA 10107602 ALTAIR 4X W/Charcoal Case LEL O2 CO H2S New  pictureMsa Altair 4x,5x Car Charger Dock Cradle
$25.0
Msa Altair 4x,5x Car Charger Dock Cradle  pictureReplacement Duo-Tox H2S/CO Sensor for MSA Altair 4/5 MSA P/N: 10089117
$179.0
Replacement Duo-Tox H2S/CO Sensor for MSA Altair 4/5 MSA P/N: 10089117 pictureReplacement Combustible LEL Sensor for MSA Altair 4/5 MSA P/N: 10089116
$159.0
Replacement Combustible LEL Sensor for MSA Altair 4/5 MSA P/N: 10089116 picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.