2

我在 corona sdk 中创建了一个滚动视图,但我遇到了一些问题,我只需要它来水平滚动。有什么帮助吗?

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);
4

2 回答 2

4

根据Corona SDK API,您可以执行以下操作:

scrollView.verticalScrollDisabled = true
于 2013-11-07T02:11:45.697 回答
2
local scrollView = widget.newScrollView{ left = 0, width = 0, height = 200, verticalScrollDisabled = true,}
于 2013-11-07T02:47:27.320 回答