【问题标题】:Horizontal ScrollView in Corona SDKCorona SDK 中的水平滚动视图
【发布时间】:2013-11-06 23:29:57
【问题描述】:

我在 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);

【问题讨论】:

    标签: lua coronasdk


    【解决方案1】:

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

    scrollView.verticalScrollDisabled = true
    

    【讨论】:

    • 谢谢我这样做了,它可以工作'local scrollView = widget.newScrollView{ left = 0, width = 0, height = 200, verticalScrollDisabled = true,}'
    【解决方案2】:
    local scrollView = widget.newScrollView{ left = 0, width = 0, height = 200, verticalScrollDisabled = true,}
    

    【讨论】:

      猜你喜欢
      • 2013-08-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-19
      • 1970-01-01
      • 2015-12-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多