B4J Question [ABMaterial] change topItem font size and color

jinyistudio

Well-Known Member
Licensed User
Longtime User
Hi, I use UpdateTopbarItem to showing time. But Could i how to chage its size and color ?

B4X:
Sub timer1_Tick
    Timer1.Interval=1000   
    Dim comp As ABMContainer = page.NavigationBar.SideBarTopComponent   
    DateTime.TimeFormat="HH:mm:ss"
    page.NavigationBar.UseTheme("topTime")
    page.NavigationBar.UpdateTopbarItem("datetime","",DateTime.Time(DateTime.Now))
End Sub

dbbd037b22d38502ff1e76238108763c.png
 

Cableguy

Expert
Licensed User
Longtime User
I think you can do it using the theme settings...
Almost every component has a forecolor, forecolor tensity, backgroundcolor and backgroundcolorintensity
 
Upvote 0

jinyistudio

Well-Known Member
Licensed User
Longtime User
I have try page.NavigationBar.UseTheme("topTime") but it is invalid.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Have you created the theme in the buildTheme or in ABMShared?
My theme.AddTopNavigationBar("topTime")
MyTheme.TopNavigationBar("topTime").ForeColor = ....

This is to be considered as pseudo-code as I am not at my pc to be sure of it
 
Upvote 0

jinyistudio

Well-Known Member
Licensed User
Longtime User
My version 2.51 has AddNavigationBarTheme. It hasn't AddNavigationBarTheme

my code as

B4X:
theme.AddNavigationBarTheme("topTime")
    theme.NavigationBar("topTime").TopBarBold = True
    theme.NavigationBar("topTime").TopBarFontSize = "18px"
    theme.NavigationBar("topTime").TopBarForeColor=ABM.COLOR_RED
 
Upvote 0
Top