iOS Question Do not load 100%x and 100y in Page

Fabio vega

Member
Licensed User
Loas Scrollview:
   If pg.IsInitialized = False Then
            pg.Initialize("pgregcli" )
            pg.Title = "Title"           
        
            SvPanel.Initialize("", 100%x,100%y)
            pg.RootPanel.AddView(SvPanel,0,0,100%x,100%y)                       
        
        
        End If
        NavControl.ShowPage(pg)        
    
        SvPanel.Panel.LoadLayout("Layout")
        SvPanel.Panel.Color =Colors.White

This simple code, do not show Scrollview 100%x and 100%y in page, in other pages found OK, some solutions ?
 

Attachments

  • scrollview.jpeg
    scrollview.jpeg
    57.3 KB · Views: 145

Fabio vega

Member
Licensed User
Thanks, The solution for other people. I using three pages metode for correct load page using. next code example

B4X:
Sub Process_Globals
    Private pg As Page  
End Sub

Sub Show
    Try
       
        If pg.IsInitialized = False Then
            pg.Initialize("pg" )
            pg.Title = "Tmovemos Colombia"              
           
        End If
        pg.RootPanel.Color=Colors.White
        Main.NavControl.ShowPage(pg)      
   
    Catch
        Msgbox(LastException,"Error")
    End Try
End Sub

Private Sub pg_Resize(Width As Int, Height As Int)
    setup_page(Width,Height)
End Sub

Sub setup_page (w As Int , h As Int)
    SvPanel.Initialize("",w,h)
    pg.RootPanel.AddView(SvPanel,0,0,w,h)
    SvPanel.Panel.LoadLayout("layout")      

End Sub
 
Upvote 0

Fabio vega

Member
Licensed User
Hello, when inten to change change by code the size se scrollview do no change, I Save Width , height in page Resize

but dot no change. the size is correct but view do no resize, any solution thanks... I put Hadle resize event (ON and OFF) and nothing

B4X:
Private Sub pgsact_Resize(Width As Int, height1 As Int)
    Mw =pg.RootPanel.Width
    Mh=pg.RootPanel.Height
End Sub

Sub Setup_layaut_sv

    Pnlsv.SetLayoutAnimated(  10, 1, 0, 50dip, Mw,Mh-50dip)
   
    Svserv.Width=Mw
    Svserv.Height=Mh-50dip
    Svserv.SetLayoutAnimated( 10, 1,0,0, Mw,Mh-50dip)
    'Msgbox("w " & Svserv.Width & " w2 " & Mw & " mh= "& Mh,"")
    Pnlsv.BringToFront
    Pnlsv.Visible=True
    PnlMap.Visible= False
    pg.ResignFocus
    Sleep(500)
End Sub
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
ok, I force only portraid support..
Will not really help.

I already told you the correct solution 5 times. Use the designer and use anchors. Everything will just work. Try it. If it doesn't work for you then upload the project.

If this is a new project then you should use B4XPages. Will be simpler.
 
Upvote 0
Top