Any advice how to get this code working such that it will:
a) Align the scrollView’s left hand side up against the left hand side of the container? In my code I have already set the anchorX for both scrollView and container to 0 however this does not seem to help?
b) Have the scrollView resize in the layout area of the code take effect? In my code I reset the width/height of the scrollView however it doesn’t take effect? I want to do this in a composer/storyboard view, where it will cater for orientation changes, portrait <=> landscape. So question is whether the storyboard concept can be used, or whether I really have to recreate the whole scrollView each time there is an orientation change…
display.setStatusBar( display.HiddenStatusBar ) local displayW, displayH = display.contentWidth, display.contentHeight --Container local myContainer = display.newContainer(10, 10) -- Background (just to show where container is) local containerBackground = display.newRect( 0, 0, 1000, 1000 ) containerBackground.strokeWidth = 0 containerBackground:setFillColor( 1,0,0 ) myContainer:insert(containerBackground) -- ScrollView local widget = require( "widget" ) -- Create the widget local scrollView = widget.newScrollView { top = 0, left = 0, width = 20, height = 20, scrollWidth = 200, scrollHeight = 200, backgroundColor = { 0.8, 0.8, 0.8 }, -- listener = scrollListener } myContainer:insert(scrollView) -- Layout myContainer.anchorX, myContainer.anchorY = 0, 0 myContainer.width, myContainer.height = 200,200 myContainer.x, myContainer.y = 0, 0 scrollView.anchorX, scrollView.anchorY = 0,0 scrollView:setScrollWidth(200) scrollView:setScrollHeight(200) scrollView.x, scrollView.y = 0,0