Scrolling Not Working In Widget 2 Scroller (Again!)

HI,

 

I mentioned this a few weeks ago, was told it was fixed (which it seemed to be) but now it’s not working again with the latest build.

 

The scroller in Widget 2.0 just pings back to the top again whenever you scroll down, so no scrollable content can be accessed.

 

Looks like I should have just stuck with the old Widget 1.0.

 

Can anyone from Corona give an update on when this is likely to be fixed and stay fixed as my app is currently unusable.

 

Thanks,

 

Ian

The problem seems to be when adding content that’s created dynamically to the scrollview. If I add something whose height I know (i.e.: an image), that is taller than the scrollview, then scrolling seems to work.

 

If I create content based on a for loop (i.e.: a series of buttons based on records in a sqllite DB), then the scrollview doesn’t seem to know how tall the content is (even if I set the scrollHeight property).

 

If anyone from Corona could shed some light on this it would be greatly appreciated.

 

Thanks,

 

Ian

I see the same thing in a horisontal scrollView.

It works in 1038, but up to 1054 i does´nt work. I can´t scroll all the way, leaving content unreachable.

The content is 6-20 widget buttons in the scrollview

Hey guys.

 

It’s hard to say whether this is a bug with widgets or something you may be doing that is causing the issue. I personally haven’t seen it and can’t say unless I see some test cases that exhibit this behaviour.

 

If you think it’s a bug and can reproduce it with a simple test case, please [buglink]

By submitting a bug report you speed up the process of this getting validated and also fixed if it is an issue with our code.

 

Thanks

Hi Danny,

 

Thanks for the reply.

 

It works fine if the content you’re adding is a known size (i.e. if I add an image which is 1000 pixels tall then scrolling works perfectly).

 

But - if I create the scrollview and then add content I create dynamically (in my case a bunch of buttons and text held within a group), the problem occurs and several other people seem to have had the same issue.

 

I’ve tried going through line by line and as soon as I swap out an image and swap in my dynamically created content I see this odd behaviour.

 

It used to work and then with the more recent builds it suddenly didn’t work again. No change to my code in the meantime - just an update to the build version I was using.

 

Thanks,

 

Ian

 

Hey Ian, what daily build are you currently using ?

Hi Danny,

 

I’ve tried with every single one of the last 10 daily builds and I get the same issue with all of them. If I go back a few builds I get another issue where the content shoots off sideways as soon as you scroll but I reported that at the time and it was fixed.

 

Thanks,

 

Ian

 

Gotcha.

 

Would you be so kind as to whip up a small test case which uses the scrollView in the same way you are using it currently that exhibits the issue and [buglink] ?

If you can do that I will take a look at this for you asap.

Hi Danny,

 

I’ve submitted a bug. I didn’t add the part of the code which populates the group I’m adding to the scrollView as that is created from a SQLite database etc.

 

If you need me to expand upon the code at all let me know and I’ll do so immediately. My e-mail address is info@keystagefun.co.uk

 

Thanks,

 

Ian

Ok - I’ve figured out what was going on here (I think).

 

First of all - it seems not to be a Corona issue (my apologies and thanks to Danny for trying to sort it so quickly). But - the code I had was working prior to an updated build, which is why I assumed it was a bug.

 

The problem I had was:

 

I was creating a ScrollView, whose only content was an empty group (display.newGroup()).

 

I was then adding content to that group.

 

So, when the ScrollView was created it thought the height was zero and therefore pinged back to the top when you tried to scroll.

 

Because I added my content to my group AFTER creating the ScrollView the ScrollView didn’t “know” it had any content within that group. If that makes sense!?

 

By making sure I populated my group with all the content before creating the ScrollView it seems to now work.

 

It would be great if the ScrollView could know when more content had been added and have its scrolling properties amended accordingly. Not sure if this is something that is / will be possible though?

 

Thanks,

 

Ian

The problem seems to be when adding content that’s created dynamically to the scrollview. If I add something whose height I know (i.e.: an image), that is taller than the scrollview, then scrolling seems to work.

 

If I create content based on a for loop (i.e.: a series of buttons based on records in a sqllite DB), then the scrollview doesn’t seem to know how tall the content is (even if I set the scrollHeight property).

 

If anyone from Corona could shed some light on this it would be greatly appreciated.

 

Thanks,

 

Ian

I see the same thing in a horisontal scrollView.

It works in 1038, but up to 1054 i does´nt work. I can´t scroll all the way, leaving content unreachable.

The content is 6-20 widget buttons in the scrollview

Hey guys.

 

It’s hard to say whether this is a bug with widgets or something you may be doing that is causing the issue. I personally haven’t seen it and can’t say unless I see some test cases that exhibit this behaviour.

 

If you think it’s a bug and can reproduce it with a simple test case, please [buglink]

By submitting a bug report you speed up the process of this getting validated and also fixed if it is an issue with our code.

 

Thanks

Hi Danny,

 

Thanks for the reply.

 

It works fine if the content you’re adding is a known size (i.e. if I add an image which is 1000 pixels tall then scrolling works perfectly).

 

But - if I create the scrollview and then add content I create dynamically (in my case a bunch of buttons and text held within a group), the problem occurs and several other people seem to have had the same issue.

 

I’ve tried going through line by line and as soon as I swap out an image and swap in my dynamically created content I see this odd behaviour.

 

It used to work and then with the more recent builds it suddenly didn’t work again. No change to my code in the meantime - just an update to the build version I was using.

 

Thanks,

 

Ian

 

Hey Ian, what daily build are you currently using ?

Hi Danny,

 

I’ve tried with every single one of the last 10 daily builds and I get the same issue with all of them. If I go back a few builds I get another issue where the content shoots off sideways as soon as you scroll but I reported that at the time and it was fixed.

 

Thanks,

 

Ian

 

Gotcha.

 

Would you be so kind as to whip up a small test case which uses the scrollView in the same way you are using it currently that exhibits the issue and [buglink] ?

If you can do that I will take a look at this for you asap.

Hi Danny,

 

I’ve submitted a bug. I didn’t add the part of the code which populates the group I’m adding to the scrollView as that is created from a SQLite database etc.

 

If you need me to expand upon the code at all let me know and I’ll do so immediately. My e-mail address is info@keystagefun.co.uk

 

Thanks,

 

Ian

Ok - I’ve figured out what was going on here (I think).

 

First of all - it seems not to be a Corona issue (my apologies and thanks to Danny for trying to sort it so quickly). But - the code I had was working prior to an updated build, which is why I assumed it was a bug.

 

The problem I had was:

 

I was creating a ScrollView, whose only content was an empty group (display.newGroup()).

 

I was then adding content to that group.

 

So, when the ScrollView was created it thought the height was zero and therefore pinged back to the top when you tried to scroll.

 

Because I added my content to my group AFTER creating the ScrollView the ScrollView didn’t “know” it had any content within that group. If that makes sense!?

 

By making sure I populated my group with all the content before creating the ScrollView it seems to now work.

 

It would be great if the ScrollView could know when more content had been added and have its scrolling properties amended accordingly. Not sure if this is something that is / will be possible though?

 

Thanks,

 

Ian