Loading Layout into ScrollView

aaronk

Well-Known Member
Licensed User
Longtime User
Hello,

I am trying to load a Layout into a ScrollView as my layout might be to big from some devices.

I have used the following code:

B4X:
Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.
   Dim scvTest As ScrollView
   Dim pnlTest As Panel
End Sub

Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("Main")
   scvTest.Panel.LoadLayout("ScrollViewLayout")
   scvTest.Panel.Height = pnlTest.Height
End Sub

The Main Layout is loading the ScrollView and the ScrollViewLayout has all my buttons etc that I want to load.

The Layout looks fine when running and viewing it in the Designer but soon as I load it using the code above, it looks like the script doesn't run the designer script.

Am I doing something wrong or are designer scripts ignored when running in a scrollView ?

Soon as I add my designer script code to the end of the Activity_Create sub it displays fine.
 
Top