我现在很困惑,因为我试图让滚动视图在 Storyboard 中工作。我在 Corona 中使用带有滚动视图的文件/示例应用程序胡闹,它可以找到滚动视图,因为它没有遵循 Storyboard。当我转到我的游戏时,我值得实现情节提要,我将图像放在板条箱屏幕中,但是当我尝试插入滚动视图时它不起作用。有人可以把这个文件放在故事板格式我会很感激。这是文件
display.setStatusBar( display.HiddenStatusBar )
local bg = display.newImage ("bg.png")
local widget = require( "widget" )
-- Our ScrollView listener
local function scrollListener( event )
local phase = event.phase
local direction = event.direction
if "began" == phase then
--print( "Began" )
elseif "moved" == phase then
--print( "Moved" )
elseif "ended" == phase then
--print( "Ended" )
end
-- If the scrollView has reached it's scroll limit
if event.limitReached then
if "up" == direction then
print( "Reached Top Limit" )
elseif "down" == direction then
print( "Reached Bottom Limit" )
elseif "left" == direction then
print( "Reached Left Limit" )
elseif "right" == direction then
print( "Reached Right Limit" )
end
end
return true
end
-- Create a ScrollView
local scrollView = widget.newScrollView
{
left = 0,
top = 0,
width = display.contentWidth,
height = display.contentHeight,
bottomPadding = 50,
id = "onBottom",
horizontalScrollDisabled = true ,
verticalScrollDisabled = false ,
hideBackground = true,
listener = scrollListener,
}
local worlds = display.newImage ("pink.png")
worlds.x = 100
worlds.y = 100
scrollView:insert( worlds)
local worlds1 = display.newImage ("pink.png")
worlds1.x = 100
worlds1.y = 800
scrollView:insert( worlds1)
local worlds2 = display.newImage ("pink.png")
worlds2.x = 100
worlds2.y = 500
scrollView:insert( worlds2)
local worlds3 = display.newImage ("pink.png")
worlds3.x = 100
worlds3.y = 1000
scrollView:insert( worlds3)
local worlds4 = display.newImage ("pink.png")
worlds4.x = 100
worlds4.y = 2000
scrollView:insert( worlds4)
我是 Corona SDK 的新手。如果有人能回答我的问题,如果您需要我放入故事板的文件,我将不胜感激,只需发表评论并进行编辑,但我没有看到任何理由,因为它不起作用。我只想要故事板格式的这个文件。