탭 막대가있는 파일에 액세스하려고 할 때 오류가 있습니다. 아무도 내가 뭘 잘못하고 있는지 안다. 코로나 SDK는 실제로 버튼이 아니라 탭 막대를 만드는 코드 섹션에 오류가 있음을 알려줍니다. 감사합니다탭 막대로 루아 파일에 접근하려면 어떻게해야합니까?
다음은 탭 표시 줄이 만들어지는 MainPage.lua 장면에 대한 코드입니다.
local tabBar = nil
function scene: create (event)
local group = scene.view
local tabButtons =
{
{
width = 20,
height = 32,
defaultFile = "assets/home.png",
overFile = "assets/PressHome.png",
label = "Home",
font = tabLabelFont,
size = tabLabelFontSize,
onPress = function() composer.gotoScene("Home"); end,
},
{
width = 20,
height = 32,
defaultFile = "assets/Explore.png",
overFile = "assets/Explore.png",
label = "Explore",
font = tabLabelFont,
size = tabLabelFontSize,
onPress = function() composer.gotoScene("Explore"); end,
},
{
width = 20,
height = 32,
defaultFile = "assets/Post.png",
overFile = "assets/Post.png",
label = "Post",
font = tabLabelFont,
size = tabLabelFontSize,
onPress = function() composer.gotoScene("Post"); end,
},
{
width = 20,
height = 32,
defaultFile = "assets/Notification.png",
overFile = "assets/Notification.png",
label = "Notification",
font = tabLabelFont,
size = tabLabelFontSize,
onPress = function() composer.gotoScene("Notification"); end,
},
{
width = 20,
height = 32,
defaultFile = "assets/Profile.png",
overFile = "assets/Profile.png",
label = "Profile",
font = tabLabelFont,
size = tabLabelFontSize,
onPress = function() composer.gotoScene("Profile"); end,
}
}
-- Create a tab-bar and place it at the bottom of the screen
tabBar = widget.newTabBar
{
top = display.contentHeight - 50,
width = display.contentWidth,
backgroundFile = "assets/tabbar.png",
tabSelectedLeftFile = "assets/tabBar_tabSelectedLeft.png",
tabSelectedMiddleFile = "assets/tabBar_tabSelectedMiddle.png",
tabSelectedRightFile = "assets/tabBar_tabSelectedRight.png",
tabSelectedFrameWidth = 20,
tabSelectedFrameHeight = 52,
buttons = tabButtons
}
group: insert(tabBar)
composer.gotoScene("Home")
end
scene:addEventListener("create", scene)
return scene
여기는 탭 모음 페이지에 액세스해야하는 로그인 페이지의 방법입니다.
local function EnterPage(event)
composer.gotoScene("MainPage")
end
이
오류 페이지에서 로그에 "한 tabBar = widget.newTabBar" 오류를 상태 라인 바로 이동stack traceback:
?: in function '?'
?: in function <?:703>
(tail call): ?
?: in function <?:122>
(tail call): ?
MainPage.lua:127: in main chunk
[C]: in function 'require'
?: in function <?:797>
(tail call): ?
LogIn.lua:78: in function <LogIn.lua:70>
?: in function <?:218>
라인 메인 페이지의 127 말하고있는 것입니다 gotoScene (MainPage) 방법
어떤 오류가 발생하고 있습니까? –
포스트에 편집을 넣습니다. –
스택 트레이스 직전에 어떤 라인이 있습니까? 실제 오류가 무엇인지 나타내야합니다. 스택 추적은 많은 양의 꼬리 재귀 (아마도 디버그 기호 제거)가 포함되어 있기 때문에 불행히도 도움이되지 않습니다. –