Android Question B4X pages - designing your own title bar

wimpie3

Well-Known Member
Licensed User
Longtime User
Has anyone already done this with B4X pages? Giving the application no title bar at all and adding your own title bar, created by code? I don't think there is an example for that on the forum. I also don't know if this is easy to accomplish since you'd have to take care of changing the titles and back arrows and so on...
 

William Lancee

Well-Known Member
Licensed User
Longtime User
You can add a BBLabel with the designer at top of page and and do anything you want with it.

In Main set
#FullScreen: True
#IncludeTitle: False

https://www.b4x.com/android/forum/t...t-engine-bbcode-parser-rich-text-view.106207/

You can add an arrow icon as a button on the Layout. You can handle the Click event of the button.

Remember that on Android you don't need an arrow. The device's Back button works the same way.
B4X:
'B4X page "p2"
Sub Class_Globals
    Private Root As B4XView 'ignore
    Private xui As XUI 'ignore
    Private BBLabel1 As BBLabel
    Private TextEngine1 As BCTextEngine
End Sub

'You can add more parameters here.
Public Sub Initialize As Object
    Return Me
End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("BBLabel")
    Sleep(100)
    TextEngine1.Initialize(Root)
    BBLabel1.TextEngine = TextEngine1
    BBLabel1.Text = $"[b][u]BBLabel[/u][/b]: [color=red]Red[/color] [color=0xFF08B31F]Green[/color] [color=blue]Blue[/color]"$
End Sub
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
this can give you an idea how to do it for B4X

Sorry spanish:
 
Upvote 0
Top