Android Question Different color on Title of a page

amorosik

Expert
Licensed User
I have a B4A procedure with several Pages
Every second the title of the currently visible Page is updated
The line I'm going to write on the title is made up of string1 which must be colored and string2 which must be black
I currently use this line of code to write the current page title

B4X:
B4XPages.SetTitle(B4XPages.GetPage(B4XPages.GetManager.GetTopPage.Id ),cs.Initialize.Color(Colors.Green).Append("C" & app_version & " ").pop.Append(conf_phone_number & " T" & NumberFormat((bat_temp/10),1,0) & " " & gps_on & gps_send_on).PopAll & cust_string)

On different smartphone it works correctly, but loading it on Samsung Tab 6 Lite tablet it doesn't 'color' string1 in the sense that it remains the default color, black
Can you help me figure out where is the error?
Or, how would you write the title of a page with different colors (that works correctly also on Tab6 lite) ?
 
Solution
can be the concatenation of cust_string
add cust_string to cs (append)

Or, how would you write the title of a page with different colors (that works correctly also on Tab6 lite) ?

Sample;
B4X:
    Dim cust_string As String = " Custrom Variable"

    Dim cs As CSBuilder
    cs.Initialize
    cs.Color(Colors.Red)
    cs.Append("Hello ")
    cs.Bold
    cs.Color(Colors.Blue)
    cs.Append("Colorfull ")
    cs.Pop.Pop 'two pops: the first removes the green...

TILogistic

Expert
Licensed User
Longtime User
can be the concatenation of cust_string
add cust_string to cs (append)

Or, how would you write the title of a page with different colors (that works correctly also on Tab6 lite) ?

Sample;
B4X:
    Dim cust_string As String = " Custrom Variable"

    Dim cs As CSBuilder
    cs.Initialize
    cs.Color(Colors.Red)
    cs.Append("Hello ")
    cs.Bold
    cs.Color(Colors.Blue)
    cs.Append("Colorfull ")
    cs.Pop.Pop 'two pops: the first removes the green color and the second removes the bold style
    cs.Append("World!")
    cs.Append(cust_string)
    cs.PopAll
    
    B4XPages.SetTitle(Me, cs)
 
Upvote 0
Solution
Cookies are required to use this site. You must accept them to continue using the site. Learn more…