how to lock a scrolling list??

data={}
data[1] = {}
data[1].title = “Set Alarm”
data[2] = {}
data[2].title = “Sound”
data[3] = {}
data[3].title = “Alarm On/Off”

myList = tableView.newList{
data=data,
default=“listItemBg.png”,
over=“listItemBg_over.png”,
onRelease=listButtonRelease,

top=topBoundary,
bottom=bottomBoundary,

callback = function( row )

if count == 1 then
g = display.newGroup()
title1 = display.newText( row.title, 20, 0, native.systemFontBold, 20 )
title1:setTextColor(0, 0, 0)
g:insert(title1)
title1.y = 35

count = count + 1
return g

else if count == 2 then

f = display.newGroup()
title2 = display.newText( row.title, 20, 0, native.systemFontBold, 20 )
title2:setTextColor(0, 0, 0)
f:insert(title2)
title2.y = 35

else
i = display.newGroup()
title3 = display.newText( row.title, 20, 0, native.systemFontBold, 20 )
title3:setTextColor(0, 0, 0)
i:insert(title3)
title3.y = 35

return i
end
end
end
}

local listBackground = display.newRect( 0, 0, myList.width, myList.height )
listBackground:setFillColor(255,255,255)
myList:insert(1,listBackground)
myList.x = 0
myList.y = 30

group:insert(myList)
this is my code for creating list. how can i lock my list from scrolling?? i have made list through tableview.lua [import]uid: 209696 topic_id: 35506 reply_id: 335506[/import]

Hello,

You should be able to add an enterFrame listener which sets the scroll position to whatever you want. I don’t know if the user would still be able to grab it and move it; if that’s the case then you can create an invisible overlay that you use to grab the user touches before they reach the scrollview.

If you need it locked at a location you only know at runtime then you can store the variables and set them when you go to lock it.

Also, please don’t repost a topic if you don’t get an answer in a few minutes, it really clutters the forums.

Edit: My fix is assuming you’re using Corona’s widget.newScrollView

Thanks!

-Treb [import]uid: 181948 topic_id: 35506 reply_id: 141104[/import]

Take a look at this page. You will see a tableview as a method called .isLocked. Set that to true and the user should be unable to scroll the tableview.

https://developer.coronalabs.com/reference/index/widgetnewtableview [import]uid: 56820 topic_id: 35506 reply_id: 141113[/import]

Hello,

You should be able to add an enterFrame listener which sets the scroll position to whatever you want. I don’t know if the user would still be able to grab it and move it; if that’s the case then you can create an invisible overlay that you use to grab the user touches before they reach the scrollview.

If you need it locked at a location you only know at runtime then you can store the variables and set them when you go to lock it.

Also, please don’t repost a topic if you don’t get an answer in a few minutes, it really clutters the forums.

Edit: My fix is assuming you’re using Corona’s widget.newScrollView

Thanks!

-Treb [import]uid: 181948 topic_id: 35506 reply_id: 141104[/import]

Take a look at this page. You will see a tableview as a method called .isLocked. Set that to true and the user should be unable to scroll the tableview.

https://developer.coronalabs.com/reference/index/widgetnewtableview [import]uid: 56820 topic_id: 35506 reply_id: 141113[/import]