2
votes

I created a scroll view in corona sdk,but i have some problem with it i need it only to scroll horizontally. Any Help?

local widget = require("widget")

local rect1 = display.newRect(20,100,150,100)
local rect2 = display.newRect(200,100,150,100)
local rect3 = display.newRect(380,100,150,100)
local rect4 = display.newRect(580,100,150,100)
local rect5 = display.newRect(780,100,150,100)

local scrollView = widget.newScrollView{ left = 0, width = 0, height = 200, }

scrollView:insert(rect1);
scrollView:insert(rect2);
scrollView:insert(rect3);
scrollView:insert(rect4);
scrollView:insert(rect5);
2

2 Answers

4
votes

According to Corona SDK API, you can do the following :

scrollView.verticalScrollDisabled = true
2
votes
local scrollView = widget.newScrollView{ left = 0, width = 0, height = 200, verticalScrollDisabled = true,}