Sub SetSubtitle(Text As Object)
#if B4A
Dim actionbar As JavaObject = B4XPages.GetManager.ActionBar
If actionbar.IsInitialized Then
actionbar.RunMethod("setSubtitle", Array(Text))
End If
#End If
End Sub
You can pass a String or CSBuilder.
Note that the subtitle will appear in all pages. If you want to change the subtitle in each page then do it in the B4XPage_Appear event.
Sub SetSubtitle(Text As Object)
#if B4A
Dim actionbar As JavaObject = B4XPages.GetManager.ActionBar
If actionbar.IsInitialized Then
actionbar.RunMethod("setSubtitle", Array(Text))
End If
#End If
End Sub
You can pass a String or CSBuilder.
Note that the subtitle will appear in all pages. If you want to change the subtitle in each page then do it in the B4XPage_Appear event.
Thanks Erel for the help.
I researched and I didn't find it, it is possible to disable the Subtitle because I only need to use it in two pages of the project.
Public Sub SetSubtitle(Text As Object)
#if B4A
Dim actionbar As JavaObject = B4XPages.GetManager.ActionBar
If actionbar.IsInitialized Then
actionbar.RunMethod("setSubtitle", Array(Text))
End If
#End If
End Sub
B4X:
Sub b4xPage_Appear
Dim cs As CSBuilder
cs.Initialize.Color(xui.Color_Red).Append("World ").Pop.Color(xui.Color_Blue).Append("Flags").PopAll
SetSubtitle(cs) 'subtitle can be text also
End Sub
In the page where I do not want it to appear I did this:
B4X:
Sub b4xPage_Appear
B4XPages.MainPage.SetSubtitle("")
' your other code
End Sub
In the page where I want to change it I did this:
B4X:
Sub b4xPage_Appear
B4XPages.MainPage.SetSubtitle("Statistics")
' your other code
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.