Designer issues when using scrollView

Penko

Active Member
Licensed User
Longtime User
Hello!

I am creating my Activity design in one layout and I am trying to load it into a scrollView, which is the only view in another Layout.

I am attaching the screenshots with the two situations:
badView - a screenshot in the case when I am loading the layout into the ScrollView panel
goodView - when I directly load the Layout for the Activity.

The other two screenshots are too big for the forum, so they can be found here:
http://software.kms-e.com/repo/paneledView.png

http://software.kms-e.com/repo/scrollView.png

Here is how I load the layout:

The way it works: (without ScrollView)
B4X:
Activity.LoadLayout("layTesting_def")[/CODE}

The way it doesn't (when loaded to ScrollView)
[CODE]Activity.LoadLayout("layTesting_newdef")  
 scrollViewMain.Panel.LoadLayout("layTesting_def")

Apart from the fact my cyan labels are missing, take a look at the Hint button. If I load the Layout directly, it's positioned correctly. But within the scrollView, it occupies the entire width and I believe the other two buttons are below.

Here are some facts to note:
  • All the positioning is handled via the Designer Script, no activity code handles that
  • 90% of the logic is in layTests_def which holds all the views
  • layTests_newdef is a Layout having only the scrollView. The designer script ensures the scrollView is expanded for the entire activity

Some others: I am using 100%x and 100%y intensively. I know that these items are relative to the parent. According to my logic:
  • with ScrollView, 100%x will return the panel width
  • without ScrollView, it returns the Activity width
That's okay, but didn't we make ScrollView's width 100%x? Then they should be identical and that wouldn't be a problem.

Also, I believe designer scripts execute whenever they are called and there is no problem that I am loading this Layout to a panel, rather than using it for the base Activity?

I am also attaching the two layouts. No Activity code is necessary as I included it above and it's just three lines.
 

Attachments

  • badView.png
    badView.png
    26.7 KB · Views: 134
  • goodView.png
    goodView.png
    35.9 KB · Views: 140
  • Layouts.zip
    3.4 KB · Views: 136
Top