Hello! I have a problem with scroll list.
Sometimes random item in a list is untouchable.
Please help me.
Logic of my list is:
local widget = require "widget" screenH = display.contentHeight screenW = display.contentWidth local scroller = widget.newScrollView{ width = screenW, height = screenH/1.671, scrollWidth = screenW/0.914, scrollHeight = screenH/0.9, horizontalScrollDisabled = true, hideBackground = true } scroller.x = 0 scroller.y = 0
An here is an item, which is a button.
local x2MultiBtnFunction = function ( event ) if event.phase == "moved" then local dx = math.abs( event.x - event.xStart ) local dy = math.abs( event.y - event.yStart ) display.getCurrentStage():setFocus( nil ) event.target = scroller.\_view event.phase = "began" scroller.\_view.touch( scroller.\_view, event ) end if event.phase == "ended" then print("x2 touch") if candys:get("candys") \< 1000 then clean() director:closePopUp() timer.performWithDelay(10, function() shop:clean() director:openPopUp("noCandysShop", "fade") end) end if candys:get("candys") == 1000 or candys:get("candys") \> 1000 then clean() director:closePopUp() timer.performWithDelay(10, function() shop:clean() director:openPopUp("x2Multiplier", "fade") end) end end return true end x2MultiBtn = widget.newButton{ defaultFile="x2Multi.png", overFile="x2Multi.png", width=407, height=117, onEvent = x2MultiBtnFunction, id = "x2MultiBtn" } x2MultiBtn.x = screenW/2 x2MultiBtn.y = screenH/1.36 x2MultiBtn.alpha=0 scroller:insert(x2MultiBtn)
Thanks in advance!