newScrollView - does it support resizing for orientation changes? (within storyboard/composer)

If :setScrollWidth() and :setScrollHeight() are not working, we will need a bug report (sample that demo’s the problem, with a config.lua and build.settings).  Please post the bugID back in this thread after you get the confirmation email.

In the mean time, I would consider having two scrollView’s, one sized for portrait and one sized for landscape.   Then based on the current orientation, hide the other one.  When you detect the orientation change, insert your objects in the other group and flip the visibility.  Depending on your scrolling, you would probably need to then reposition the scrollView to the right place.  Yes, this seems harsh, but orientation changes are harsh.   Even with Web sites, responsive designs have to execute a lot of JavaScript to re-draw the screen to fit the new layout.   This should be somethign that would happen fast enough to be covered in a single frame update.

HI Rob - it’s actually not the scrollable content height/width that I need to change, but the height/width of the scroll window.   It seems when you change the width/height (not scrollable content width/height) it partially works, but aspects such as the mask aren’t set properly.   

I’d thought I’d put a feature request in for this but it was for the same thing for newText (http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback/suggestions/5416755-support-newtext-width-height-changes-e-g-to-supp)

What do you think, is this a bug or feature request?  Perhaps a feature request that widgets support width/height changes (and therefore orientation changes) in general?

Are you using a Mask?  With Graphics 2.0 They use containers which don’t need masks and I know containers are resizable.

I would go ahead and make a bug report because I think you should be able to change the width and height.

Rob

Yes, we are talking about the scrollView width & height, not the content’s.

I do redraw the whole scrollView when orientation happens for now, but to change a display object width/height should be supported directly I think.

submitted as bug - Case 31122

display.setStatusBar( display.HiddenStatusBar )  local widget = require( "widget" ) background = display.newRect( display.contentWidth/2, display.contentHeight/2, display.contentWidth, display.contentHeight) background.strokeWidth = 0 background:setFillColor(.9, 0.9, .8) ----------------------------------------- -- STTEP 1 - INITIAL SETUP ----------------------------------------- local scrollView = widget.newScrollView {     left = 50,    top = 50,     width = 200,    height = 100,     scrollWidth = 300, scrollHeight = 300,     id = "onBottom",     backgroundColor = { 0.8, 0.8, 0.8 }, } local lotsOfText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur imperdiet consectetur euismod. Phasellus non ipsum vel eros vestibulum consequat. Integer convallis quam id urna tristique eu viverra risus eleifend.\n\nAenean suscipit placerat venenatis. Pellentesque faucibus venenatis eleifend. Nam lorem felis, rhoncus vel rutrum quis, tincidunt in sapien. Proin eu elit tortor. Nam ut mauris pellentesque justo vulputate convallis eu vitae metus. Praesent mauris eros, hendrerit ac convallis vel, cursus quis sem. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque fermentum, dui in vehicula dapibus, lorem nisi placerat turpis, quis gravida elit lectus eget nibh. Mauris molestie auctor facilisis.\n\n " local lotsOfTextObject = display.newText( lotsOfText, display.contentCenterX, 0, 300, 0, native.systemFont, 14) lotsOfTextObject:setFillColor( 0 )  lotsOfTextObject.anchorY = 0.0        -- Top scrollView:insert( lotsOfTextObject ) ----------------------------------------- -- STTEP 2 - INITIAL SETUP ----------------------------------------- local testWithDynamicChange = true if testWithDynamicChange then     scrollView.width = 300     scrollView.height = 400 end  

I find that I am able to set the scrollView.height at runtime. What happens when you try?

ksan, try the code greg886 posted above.

I change the line for newText to

local lotsOfTextObject = display.newText( lotsOfText, 0, 0, 300, 0, native.systemFont, 14)

And you should see when the height/width of scrollView is changed, something is screwed.

I just tried with the latest build and the bug still exists (of course).

Yup. The background color for example does not readjust to the new size of the scrollView. The text also is placed funny. I totally agree there is lots to be fixed in there still. Thanks for submitting the bug report. The example is a little misleading though. The problem is not just related to the scrollView. The scrollView actually does resize but the text inside it does not. newText does not allow you to resize or change width etc at runtime. So you need to remove and readjust your text object placement in the scrollView.

Ksan,

in my own code, I do use texts inside the scrollView, however I don’t change the widths for the texts. I just want to change the height of the scrollView while orientation happens. And it doesn’t work as expected either. 

So if we just talk about changing the height, I think it can simplify a bit for the problem… still scrollView problem I think.