Android Question Transparent StatusBar Using B4XPages

moinamh

Member
I tried using this code for Transparent StatusBar that I learned from This Post On B4XPages for my new project :
B4X:
    Dim ph As Phone
    If ph.SdkVersion >= 4.4 Then
        Dim jo As JavaObject
        Dim window As JavaObject = jo.InitializeContext.RunMethod("getWindow", Null)
        window.RunMethod("addFlags", Array(Bit.Or(0x00000200, 0x08000000)))
        Root.Height = Root.Height +80dip
    End If
        Dim pnl As Panel
        pnl.Initialize("")
        pnl.Color = Colors.Transparent
        Root.AddView(pnl, 0, Root.Height + 24dip, 100%x, 80dip)
But I ended up facing this White Space in bottom of the Page.
B4a_SS.PNG

I'm new to B4XPages so I would appreciate any solution.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
1608016955934.png



See:
1. Manifest editor.
2. Activity_Create:
B4X:
Sub Activity_Create(FirstTime As Boolean)
    Dim jo As JavaObject
    Dim window As JavaObject = jo.InitializeContext.RunMethod("getWindow", Null)
    window.RunMethod("addFlags", Array(Bit.Or(0x00000200, 0x08000000)))
    Activity.Height = Activity.Height + 24dip
    Dim pm As B4XPagesManager
    pm.Initialize(Activity)
End Sub
3. main page:
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.SetLayoutAnimated(0, 0, 0, Root.Width, Root.Height + 24dip)
    Root.LoadLayout("MainPage")
End Sub

Private Sub B4XPage_Appear
    Root.Height = B4XPages.GetNativeParent(Me).Height
End Sub
 

Attachments

  • Project.zip
    13.9 KB · Views: 582
Upvote 0
Top