Bug? ScrollView

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Hi, Klaus. Sorry, as usual I was out. I tried your code that works, of course. But, it was a problem of my test only (the fact that I tried to scroll having not inserted a new line in the scrollview). If things were like in that my example, clearly there is (perhaps) no sense in scrolling down without a new line inserted.(. but ..who knows..). Anyway let's fix that scrolling works, according the fact that the ScrollView contains a new line and the ScrollToNow is called inside a delayed call. As a "counter-example", see the attached app, with a direct call. You can see the "mess" that happens, just calling directly ScrollToNow.. (Hope there is not an error of mine, again, but I just commented the two CallDelayed, substituting them with direct calls). First "Amazing thing" is that if somebody hopes that issuing a ScrollToNow call, after filling a ScrollView, will show a the ScrollView at the end position, he will be disappointed. As a matter of fact the initial appearance of the ScrollView is without any scroll. Then see what happens adding lines...
Thanks for your patience. Your suggestions resolved, and hopefully somebody else can benefit from our discussion. It remains the doubt about the fact that perhaps these "hidden" mechanisms requesting a delayed call could involve other functions... Thanks again.
 

Attachments

  • ScrollDirect.zip
    7.3 KB · Views: 172

klaus

Expert
Licensed User
Longtime User
When I wrote the ClsWheel class I had experienced that the ScrollView.ScrollPosition setting is tricky.
It needs DoEvents or like in the code I posted CallSubDelayed.

In your last test project this line is wrong:
SViTab.Panel.Height = nItems * hRow
it must be
SViTab.Panel.Height = (nItems + 1) * hRow
 

klaus

Expert
Licensed User
Longtime User
Hi Giovanni,
I had contact with Erel, and the problem when changing the ScrollView.Panel.Height, and no effect on the screen, without having added any view to it is a problem in Android.
If you really need it, the only workaround is to add a view, change the height and remove the view.
Attached the test project showing the problem and the workaround.
Clicking on Increas has no effect on the screen but the panel height is changed internally.
Clicking on Add/Remove changes the panel height and is visible on the screen.
Clicking on Add works 'noramly'.
 

Attachments

  • New21.zip
    7.4 KB · Views: 173
Top