iOS Question White bar on iPhone Xs

schimanski

Well-Known Member
Licensed User
Does anybody know, why the tabstrip shows a white bar under the pages on iPhone Xs? This doesn't happens on iPhone 8:

iphone xs.PNG


iphone 8.PNG
 

schimanski

Well-Known Member
Licensed User
I'm adding the table to the pages with the following code. The bar is only shown in portrait, not in landscape-mode:
B4X:
for i=1 to Count
   tabpage(i).Initialize("tabpage" & i)  
   tabpage(i).Title = Name(i)
   table(i).Initialize(Me, "Table" & i, 8)
   table(i).AddToParent(tabpage(i).RootPanel, 0, 0,100%x, 100%y)
..
next
 

schimanski

Well-Known Member
Licensed User
I will try to make a short project. For this moment, there is also a behavior, that can help: On IPhone 8, the white bar also exists, when the iphone shows some informations like number of devices which are connected to the hotspot in the blue statusbar on top.
 

Erel

Administrator
Staff member
Licensed User
I see it as well. It looks like a limitation of the underlying library related to devices with notch.

This code should fix it:
B4X:
Sub MainPage_Resize (Width As Float, Height As Float)
   If TabStrip1.IsInitialized And App.OSVersion >= 11 Then
       Dim no As NativeObject = TabStrip1
       Dim window As NativeObject = App
       window = window.GetField("keyWindow")
       Dim f() As Float = window.ArrayFromEdgeInsets(window.RunMethod("safeAreaInsets", Null))
       If f(1) > 0 Then
           Dim Container As View = no.GetField("containerView")
           Sleep(50)
           Dim PrevTop As Int = Container.Top
           Container.Top = 44 - f(1)
           Container.Height = Container.Height + PrevTop - Container.top
       End If
   End If
End Sub
 
Top