Content Width Area Of New Scrollview Widget Not Dynamic?

Hi,

I use the new scrollView widget.

I insert my objects on it using this : scrollView:insert(object). Classic stuff.

My scrollview’s “content” grows as I insert new objects on it. Classic stuff too.

Then, If I clean objects which are on the scrollView, scrollView content width doesn’t adapt itself to the new “width content”.

It seems that scrollView content area can grow but can’t reduce itself.

It’s just as if content width area of new scrollView widget was not dynamic when you reduce the content area

You still can scroll to empty area…

 

Is this a bug? 

Any help would be appreciate

Sincerely,

Olivier

 

[quote name=“oromanetti” post=“169487” timestamp=“1363129928”]Hi, I use the new scrollView widget. I insert my objects on it using this : scrollView:insert(object). Classic stuff. My scrollview’s “content” grows as I insert new objects on it. Classic stuff too. Then, If I clean objects which are on the scrollView, scrollView content width doesn’t adapt itself to the new “width content”. It seems that scrollView content area can grow but can’t reduce itself. It’s just as if content width area of new scrollView widget was not dynamic when you reduce the content area You still can scroll to empty area…   Is this a bug?  Any help would be appreciate Sincerely, Olivier  [/quote] Hey Olivier. Nice catch! Would you be so kind as to file a bug report about this so i can get this in the queue for my widget bugs to fix this week? Thanks

Ok Danny I do it right now :slight_smile:

Olivier

 

 

I am having a issue with ScrollView widget 2.0 when using it as a VERTICAL scrollview.    it seems to has all sorts of odd behaviors.  here is the code i am using:

 

[lua]

 

  --************************************************************************

  --*****     Define Scroll View

  --************************************************************************

 

  local widget = require “widget”

 

  local scrollViewListener,gMiddle2

 

  function scrollViewListener(event) – the listener MUST come before the scroll view is defined in the code.

    local phase = event.phase

    local direction = event.direction

 

    if “began” == phase then

        --print( “Began” )

    elseif “moved” == phase then

        --print( “Moved” )

    elseif “ended” == phase then        

        --print( “Ended” )

    end

 

    – If we have reached one of the scrollViews limits

    if event.limitReached then

        if “up” == direction then

            --print( “Reached Top Limit” )

        elseif “down” == direction then

            --print( “Reached Bottom Limit” )

        elseif “left” == direction then            

            --print( “Reached Left Limit” )

        elseif “right” == direction then

            --print( “Reached Right Limit” )

        end

    end

 

    return true

  end

 

  gMiddle2 = widget.newScrollView {

    id = “gMiddle2”,

    top = 0,

    left = 0,

    width = _x,

    height = _y,

    scrollWidth = _x,

    scrollHeight = _y,

    topPadding = 0,

    bottomPadding = 0,

    leftPadding = 0,

    rightPadding = 0,

    friction = .972, – how fast the scroll view moves.  default is .972

    backgroundColor = {39,170,226,255},

    hideBackground = false, – if true it wont show the background color.

    horizontalScrollDisabled = true,

    verticalScrollDisabled = false,          

    listener = scrollViewListener,

    }

 

[/lua]

 

if i use this same code as a horizontal scorllview it works fine.  i just switch the horizontalScrollDisabled to false and the vertical one to true… and it works normally.

 

is this on your list to fix Danny?

Danny,

 

I’ve just reported a bug on the “report a bug section”.

 

(Case 21679) ScrollView widget : 3 bugs 

 

This report is on 3 parts.

I put a sample to illustrate the 3 parts.

 

Thank you for checking

Hope this helps.

 

Best,

Olivier

 

 

Can you please elaborate on the “oddities”? I’m not sure what issues you are facing.

Thanks

 

 

Thanks !

 

Ok the above scroll view gives me this result:

 

screen loads:

1.png

 

i tap anywhere in the scroll view and it does this:  (it pads itself way down from the top, thought the code says there is none)

2.png

 

and now i tr and USE the scrollview and it does this:  (It adds padding in on the left side…)

3.png

 

 

it was hard to describe these odities.  so… hope the pictures help.

 

Gotcha.

It sounds like your using daily build 1040 or less.

 

Please grab the latest daily build 1053 and let me know if the issues are resolved.

 

Cheers

 

 

ok it appears to work in build 1053 (tested only in the simulator)  i was on build 1041 on my PC and the mac was on build 1043  which also seemed to have the issue.  BUT,  build 1053 seems to have this fixed.    i didnt try that daily build because i didnt see anything in the notes about a scrollview fix.  

 

thanks!

[quote name=“oromanetti” post=“169487” timestamp=“1363129928”]Hi, I use the new scrollView widget. I insert my objects on it using this : scrollView:insert(object). Classic stuff. My scrollview’s “content” grows as I insert new objects on it. Classic stuff too. Then, If I clean objects which are on the scrollView, scrollView content width doesn’t adapt itself to the new “width content”. It seems that scrollView content area can grow but can’t reduce itself. It’s just as if content width area of new scrollView widget was not dynamic when you reduce the content area You still can scroll to empty area…   Is this a bug?  Any help would be appreciate Sincerely, Olivier  [/quote] Hey Olivier. Nice catch! Would you be so kind as to file a bug report about this so i can get this in the queue for my widget bugs to fix this week? Thanks

Ok Danny I do it right now :slight_smile:

Olivier

 

 

I am having a issue with ScrollView widget 2.0 when using it as a VERTICAL scrollview.    it seems to has all sorts of odd behaviors.  here is the code i am using:

 

[lua]

 

  --************************************************************************

  --*****     Define Scroll View

  --************************************************************************

 

  local widget = require “widget”

 

  local scrollViewListener,gMiddle2

 

  function scrollViewListener(event) – the listener MUST come before the scroll view is defined in the code.

    local phase = event.phase

    local direction = event.direction

 

    if “began” == phase then

        --print( “Began” )

    elseif “moved” == phase then

        --print( “Moved” )

    elseif “ended” == phase then        

        --print( “Ended” )

    end

 

    – If we have reached one of the scrollViews limits

    if event.limitReached then

        if “up” == direction then

            --print( “Reached Top Limit” )

        elseif “down” == direction then

            --print( “Reached Bottom Limit” )

        elseif “left” == direction then            

            --print( “Reached Left Limit” )

        elseif “right” == direction then

            --print( “Reached Right Limit” )

        end

    end

 

    return true

  end

 

  gMiddle2 = widget.newScrollView {

    id = “gMiddle2”,

    top = 0,

    left = 0,

    width = _x,

    height = _y,

    scrollWidth = _x,

    scrollHeight = _y,

    topPadding = 0,

    bottomPadding = 0,

    leftPadding = 0,

    rightPadding = 0,

    friction = .972, – how fast the scroll view moves.  default is .972

    backgroundColor = {39,170,226,255},

    hideBackground = false, – if true it wont show the background color.

    horizontalScrollDisabled = true,

    verticalScrollDisabled = false,          

    listener = scrollViewListener,

    }

 

[/lua]

 

if i use this same code as a horizontal scorllview it works fine.  i just switch the horizontalScrollDisabled to false and the vertical one to true… and it works normally.

 

is this on your list to fix Danny?

Danny,

 

I’ve just reported a bug on the “report a bug section”.

 

(Case 21679) ScrollView widget : 3 bugs 

 

This report is on 3 parts.

I put a sample to illustrate the 3 parts.

 

Thank you for checking

Hope this helps.

 

Best,

Olivier

 

 

Can you please elaborate on the “oddities”? I’m not sure what issues you are facing.

Thanks

 

 

Thanks !

 

Ok the above scroll view gives me this result:

 

screen loads:

1.png

 

i tap anywhere in the scroll view and it does this:  (it pads itself way down from the top, thought the code says there is none)

2.png

 

and now i tr and USE the scrollview and it does this:  (It adds padding in on the left side…)

3.png

 

 

it was hard to describe these odities.  so… hope the pictures help.

 

Gotcha.

It sounds like your using daily build 1040 or less.

 

Please grab the latest daily build 1053 and let me know if the issues are resolved.

 

Cheers

 

 

ok it appears to work in build 1053 (tested only in the simulator)  i was on build 1041 on my PC and the mac was on build 1043  which also seemed to have the issue.  BUT,  build 1053 seems to have this fixed.    i didnt try that daily build because i didnt see anything in the notes about a scrollview fix.  

 

thanks!

Hello,

I’m getting the same issue as Oliver but with the height (I’m using a vertical scroll). I add content with scrollView:insert(object) and my scroll grows correctly, but when I remove objects, the scroll doesn’t adapt to the new height.

Has this issue been solved?

Thanks.

what build of corona are you using? This was fixed a while ago

build 2013.1095