iOS Question Autoscale Scrollview contents

kohle

Active Member
Licensed User
Longtime User
There is a scrollview example for b4a (works fine) which i try to adapt to b4i with a problem.

B4A :
B4X:
    Activity.LoadLayout("layEdit")
    sv.Panel.LoadLayout("layEditDetail")
    sv.Panel.Height = PA.Height

In B4i I try this :

B4X:
pgED.Initialize("pgED")
pgED.RootPanel.LoadLayout("layEdit")
sv.Panel.LoadLayout("layEditDetail")
        
sv.ContentHeight = PA.Height
sv.ContentWidth = PA.Width


The scrolling height is ok, the problem are the fields in PA Panel, they are
not autoscaled to the witdth of th scrollview.

The width seems to be the width of the panel view.
 

kohle

Active Member
Licensed User
Longtime User
It is a mistake to load the layout before the inner panel size is set (in both B4A and B4i). First set ContentHeight and ContentWidth and then load the layout.

I dont know the height and the width of "layEditDetail" (tall panel) befote I load it.
 
Upvote 0
Top