Android Question [B4X] B4XPages + B4XDrawer - Title Hide-show

f0raster0

Well-Known Member
Licensed User
Longtime User
Last edited:

f0raster0

Well-Known Member
Licensed User
Longtime User
How about show "" as title?

B4X:
B4XPages.SetTitle(Me, "")
yes, tried that but continue showing the place where the title was..

maybe there is a option to have the same color in "title" and body?
photo_2022-12-12_23-41-07.jpg
 
Upvote 0

PaulMeuris

Active Member
Licensed User
The immersive mode is the way to go here.
Immersive mode
Don't forget to set the Activity attribute FullScreen to true.
B4X:
#Region  Activity Attributes
    #FullScreen: True
    #IncludeTitle: False
#End Region

The user can bring back the bars by swiping near the edges.
Sorry, but this feature doesn't seem to work on my Samsung J7.
 
Last edited:
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
thanks, not sure if it works for me, I tried with those options before posting getting error when open page2 because there I want to see the title.

Only want to hide title+bar in login page .. in both Android and iOS
 
Upvote 0

PaulMeuris

Active Member
Licensed User
In Android you can do the following.
You can hide the ActionBar in the MainPage and show in the other pages.
in B4XMainPage:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    B4XPages.SetTitle(Me,"")
Private Sub B4XPage_appear
    Dim jo As JavaObject = B4XPages.GetManager.ActionBar
    jo.RunMethod("hide",Null)   
End Sub
In the other pages you can use this code.
in another page:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("cat_layout")
    B4XPages.SetTitle(Me,"Category")
End Sub
Private Sub B4XPage_appear
    Dim jo As JavaObject = B4XPages.GetManager.ActionBar
    jo.RunMethod("show",Null)
End Sub
Note: the first time the MainPage layout appears the title of the project is briefly shown.
Note 2 : you need to include the JavaObject library in your project.
In iOS it seems you have to do something with the NavControl or NavigationController.
Maybe somebody with an iOS device can help you there.
Happy coding!
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
Ok. after a couple tests, it looks like the solution in post#6 is adding a bar in the bottom,
photo_2022-12-14_20-01-46.jpg


in B4XMainPage
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    'load the layout to Root
    Root.LoadLayout("Login")
    B4XPages.SetTitle(Me,"")
 
    Page2.Initialize
    B4XPages.AddPage("Page 2", Page2)
    Page3.Initialize
    B4XPages.AddPage("Page 3", Page3)
End Sub

Sub B4XPage_Appear
    #If B4a
    Dim jo As JavaObject = B4XPages.GetManager.ActionBar
    jo.RunMethod("hide",Null)
    txtUser.Text = ""
    #End If
 
'     #If B4i
'    Main.NavControl.NavigationBarVisible = False
'  #End If
End Sub
 
Last edited:
Upvote 0

josejad

Expert
Licensed User
Longtime User
Maybe your best options is to add a full screen Activity for the Login page (or settle for setting the title to "Login" in a B4XPages)

This example is for B4XPages + full screen Activity

 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
Maybe your best options is to add a full screen Activity for the Login page (or settle for setting the title to "Login" in a B4XPages)

This example is for B4XPages + full screen Activity


will not migrate my app compact to pages for now..spending too much time already on that titl's bar.
 
Upvote 0
Top