1

所以我想做一个多轮选择器,这样

dataWheel1 = {"Standard", "Inverse Standard", "Hyperbolic", "Inverse Hyperbolic"}  
dataWheel2 = {"Sine", "Cosine", "Tangent", "Secant", "Cosecant", "Cotangent"}  

所以我做了以下事情:

local storyboard = require( "storyboard" )
local scene = storyboard.newScene()

function scene:createScene( event )
    local group = self.view

    local bg = display.newRect( 0, 0, display.contentWidth, display.contentHeight )
    bg:setFillColor( 255 )

    local widget = require "widget"

    local columnData = {}

    columnData[1] = {"Standard", "Inverse Standard", "Hyperbolic", "Inverse Hyperbolic"}
    columnData[1].alignment = "right"
    columnData[1].width = 120
    columnData[1].startIndex = 7

    columnData[2] = {"Sine", "Cosine", "Tangent", "Secant", "Cosecant", "Cotangent"} 
    columnData[2].startIndex = 2

    local picker = widget.newPickerWheel{
    id="myPicker",
    font="Helvetica-Bold",
    top=258,
    columns=columnData
    }

    group:insert( picker.view )
    group:insert( bg )
end

function scene:enterScene( event )
    local group = self.view
end

function scene:exitScene( event )
    local group = self.view
end

function scene:destroyScene( event )
    local group = self.view
end

scene:addEventListener( "createScene", scene )

scene:addEventListener( "enterScene", scene )

scene:addEventListener( "exitScene", scene )

scene:addEventListener( "destroyScene", scene )

return scene

这在模拟器上显示为空白页。我完全不知道哪里出了问题或如何改正。

任何帮助将不胜感激,谢谢。

4

1 回答 1

0

看看这个例子。我认为你需要这样做:

 local varName = require "widget"
于 2012-10-07T13:51:10.577 回答