iOS Question Crazy Scrollview issues#!%

JohnC

Expert
Licensed User
Longtime User
I mostly use B4A, but I need to update an old non-B4Xpages B4i app to add a new screen (the client won't pay to convert it).

Basically, when this new page of the clients app loads, I need to hide some of the views in the layout and possibly reposition other views. Then after everything is in place, I will resize the hosting panel to fit just the views that are visible. And since there is the possibility that I might end up with more views than can fit on the screen, I am using a scrollview.

In the attached example app, there are seven buttons stacked on top of each other on a panel, but the panel they are on I purposefully made not tall enough to fit all seven buttons so it will simulate the situation in which I need to resize the panel at runtime to properly display the views that were determined to be visible when the page loads.

So, I though it would be a simple matter of resizing the panel that the buttons are on when the page is loaded/resized, so all seven buttons can be seen.

But I am getting crazy results:

1) Upon running the app, you will get the below screenshot with buttons 6 and 7 not visible and only 3/4 of button5 visible - it seems my attempt to adjust the height of the hosting panel (panel1) to be tall enough to display button7 is not working for some reason.
2) When I run the app, the Page1_Resize event reports a particular screen height (which is the same as 100%y), but if I then wait a second or two and then click button 1 to manually force a rerun the resizing code, the 100%y value is now different (smaller) - indicating that the screen size seem to have changed after the initial Page1_Resize event, without the Page1_Resize event triggering again.
3) Only after clicking the Button1 THREE times, will the page then appear as desired - with all seven buttons being visible (need to scroll up to see button 7).

I must be missing something obvious, so if anyone has a hint of what is going on, your insight would be greatly appreciated :)
ScreenShotError-50%.png
 

Attachments

  • WFTScrollView.zip
    4.8 KB · Views: 124
Last edited:
Solution
  1. Dont waste your time with ScrollView and switch to xCustomListView
  2. This checkbox and AutoScale must never, ever be checked and autoscale must never be in the designer script in layouts that are added to a list
    1. 1715250181149.png
  3. And never use %y or %x outside the Page_Resize event (just a tip)

modified project is attached.

Result after app start:
(64) mage.png

Alexander Stolte

Expert
Licensed User
Longtime User
  1. Dont waste your time with ScrollView and switch to xCustomListView
  2. This checkbox and AutoScale must never, ever be checked and autoscale must never be in the designer script in layouts that are added to a list
    1. 1715250181149.png
  3. And never use %y or %x outside the Page_Resize event (just a tip)

modified project is attached.

Result after app start:
(64) mage.png
 

Attachments

  • WFTScrollView.zip
    6 KB · Views: 93
Upvote 4
Solution

JohnC

Expert
Licensed User
Longtime User
Thank you @Alexander Stolte! I wasted almost half a day dealing with that.

Donation on it's way (for this and some other libs of yours I am now using) :)
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
wasted almost half a day dealing with that.
It's always things like this that take a lot of time. I threw away half of last Sunday to fix an error that wasn't an error, just a wrong number in the designer...

Donation on it's way (for this and some other libs of yours I am now using) :)
Thank you very, very, very much! :)
 
Upvote 0
Top