iOS Question Button location is changing

Shay

Well-Known Member
Licensed User
I have this code
if I move from this page and come back to it 2-3 times
the button either disapear (going down - I can see part of it)
or cover ~80% of screen, or all page is going up

B4X:
Public Sub Initialize
    If Page1.IsInitialized = False Then
        Page1.Initialize("Page1")
        Page1.RootPanel.Color = Colors.RGB (54,54,54)
        Page1.HideBackButton = True ' block button back
     
        If ButtonClose.IsInitialized = False Then
          ButtonClose.Initialize("ButtonClose",ButtonClose.STYLE_SYSTEM)
        End If
        ButtonClose.Visible = False
 
        If scvMain.IsInitialized = False Then
          scvMain.Initialize("scvMain",100%x, 100%y)
        End If
        scvMain.Color = Colors.Black
        scvMain.ScrollEnabled = True
 
        Page1.RootPanel.AddView(scvMain, 0dip, 0dip, 100%x, 85%y)
        Page1.RootPanel.AddView(ButtonClose, 110dip, 87%y, 130dip, 50dip)
 
        ButtonClose.CustomLabel.Font  = Font.CreateNew (20)
     
   
    End If
 
    Main.NavControl.ShowPage(Page1)
     
 
End Sub
edit: I think it is also the ScrollView is changing location and size (it has same color as my button)

edit2: I removed the button and I still see this issue, so it is not related to the button, something is very wrong with the scrollview
 
Last edited:

Shay

Well-Known Member
Licensed User
Thanks, issue solved
I moved it to designer and also had to add the following code:
scvMain.ContentHeight = 100%y
scvMain.ContentWidth = 100%x
 
Top