local widget = require( "widget" ) local background = display.newImageRect( "matrixcode.jpg", 1200, 1600 ) background:setReferencePoint( display.TopLeftReferencePoint ) background.x, background.y = 0,0 background:toBack() local background2 = display.newImageRect( "BlueSelect.png", 700, 1600 ) background2:setReferencePoint( display.TopLeftReferencePoint ) background2.x, background.y = 0,0 local somesheet = graphics.newImageSheet( 'gfx\_widgets.png' , system.ResourceDirectory, { sheetContentWidth = 512, sheetContentHeight = 512, width = 40, height = 40, numFrames = math.floor(512 / 40) \* math.floor(512 / 40) } ) local myScrollView = widget.newScrollView { top = 700, left = 36, width = 692, height = 328, horizontalScrollDisabled = true, hideScrollbar = false, topPadding = 700, --bottomPadding = -7, --leftPadding = 20, --rightPadding = 20, backgroundColor = { 255, 255, 255, 127 }, --hideBackground = true, --maskFile = "myscrollmask\_1.png", scrollBarOptions = { sheet = somesheet, topFrame = 21, middleFrame = 23, bottomFrame = 22, }, --listener = function( event ) -- local phase = event.phase --local direction = event.direction --end, } myScrollView:insert(background2)
There’s my main.lua for my test case. My attachments are no longer available, new demo file below.
-
why do I need a huge topPadding? I have this huge gap at the bottom of the scrollpane =/
-
after I add the mask, why doesn’t the scrollbar show up correctly?..even in before the mask it isn’t showing up correctly.
Thanks for taking a look anyway.