iOS Question Panel-Position is wrong on the iPhone

D

Deleted member 103

Guest
Hi,

Something is wrong, but I do not know what it could be.

On the iPad, the position of panel "pnlHaeder" is correct, on the iPhone it appears offset down.

In Designerscript I have:
B4X:
'Alle View in Panel "pnlscrView"
pnlHaeder.Top=0
pnlHaeder.Height=25
pnlHaeder.SetLeftAndRight(0, pnlscrView.Width)
lblHeader1.SetLeftAndRight(pnlHaeder.Width * 0.13, pnlHaeder.Width * 0.46) :lblHeader1.Height=pnlHaeder.Height
lblHeader2.SetLeftAndRight(pnlHaeder.Width * 0.48, pnlHaeder.Width * 0.75) :lblHeader2.Height=pnlHaeder.Height
lblHeader3.SetLeftAndRight(pnlHaeder.Width * 0.75, pnlHaeder.Width * 0.99) :lblHeader3.Height=pnlHaeder.Height

scrView.SetLeftAndRight(0, pnlscrView.Width)
scrView.SetTopAndBottom(pnlHaeder.Bottom, pnlscrView.Height)

and in Page1_resize I have to test the following:
B4X:
Private Sub Page1_Resize(Width As Int, Height As Int)
    ...
    pnlHaeder.top = 0
    pnlHaeder.Left = 20
    scrView.Color = Colors.Green
    Log("2.pnlHaeder.Top= " & pnlHaeder.Top)
End Sub

Log:
Application_Start
InitApp
2
Application_Active
Page1_Resize
2.pnlHaeder.Top= 0

screenshot iPad:
upload_2018-9-24_19-12-11.png


screenshot iPhone:
upload_2018-9-24_19-13-14.png
 
Last edited by a moderator:

JordiCP

Expert
Licensed User
Longtime User
I see, sorry for the confusion ;)

Could it be that pnlHeader.Top=0 (correct), but its parent (pnlScrView?) position is not the expected one?
 
Upvote 0
D

Deleted member 103

Guest
Panel "pnlscrView" is the parent and is correct, only pnlHaeder is shifted, but only on the iPhone.

I even tried this, but the result is the same.

B4X:
Private Sub Page1_Resize(Width As Int, Height As Int)
    ...
    pnlHaeder.RemoveViewFromParent
    pnlscrView.AddView(pnlHaeder, 0, 0, pnlscrView.Width, 25)

    pnlHaeder.top = 0
    pnlHaeder.Left = 20
    scrView.Color = Colors.Green
    Log("2.pnlHaeder.Top= " & pnlHaeder.Top)
End Sub
 
Upvote 0

JordiCP

Expert
Licensed User
Longtime User
Strange! I would double check visually that pnlscrView is where it should be by painting it with a different color...otherwise, no idea of what can be the problem o_O
 
Upvote 0
D

Deleted member 103

Guest
Please try to reproduce it in a small project with only the layout and upload it.
It will be very difficult, it is very complex.

What I want to understand is why the log shows "pnlHaeder.Top = 0", even though the position (see picture above "screenshot iPhone:") is clearly offset downwards.
I have never had this mistake since using B4i.

I measured it exactly, there are 17 pixels, as much as the statusbar.
The statusbar is invisible because the layout is a full screen, is that the reason for the error?
 
Upvote 0
D

Deleted member 103

Guest
The problem seems a combination of SideMenuController + AutoRotate.

I have removed the library SideMenuController and now everything is OK.

So problem not solved but only bypassed. :(

Now I have to create a MenuController myself.:rolleyes:
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Most likely the problem and the animation.
He also gave me a similar problem. I solved by putting a sleep(400) before placing a panel, so as to wait for the animation to end.
 
Last edited:
Upvote 0
Top