在Corona模拟器中,widget可以显示,但是在设备上却不能显示。

在模拟器小部件显示良好,但在设备上存在一些缺失的情况。因此,我甚至更新了 corona 并开始从 1.0 迁移到 Graphics 2.0 引擎,宽度/高度似乎也不会造成问题,但我仍然有这个问题。

这是代码的一部分: menu.lua

ExitBtn = widget.newButton{
    defaultFile="images/exit.png",
    overFile="images/exit2.png",
    width=44, height=44,
    onRelease = onExitBtnRelease
}
ExitBtn.anchorX,ExitBtn.anchorY = 0.5, 0.5
ExitBtn.x = display.contentWidth-28
ExitBtn.y = 24+50
InfoBtn = widget.newButton{
    defaultFile="images/info.png",
    overFile="images/info2.png"
    width=46, height=46
    --onRelease = onExitBtnRelease
}
InfoBtn.anchorX,InfoBtn.anchorY = 0.5, 0.5
InfoBtn.x = ExitBtn.x-ExitBtn.width-8
InfoBtn.y = ExitBtn.y+2

group:insert( bg1 )
group:insert( bg2 )
group:insert( background )
group:insert( playBtn )
group:insert( ScoresBtn )
group:insert( HowBtn )
group:insert( ExitBtn )
group:insert( InfoBtn)

这是 onExitBtnRelease 函数

local function onExitBtnRelease()
    native.requestExit()
    return true
end

菜单屏幕应该是这样的(下面链接的图片),但右上角的按钮在设备上丢失了。 http://s9.postimg.org/rz1c8nu27/start_screen.png

点赞
用户1392789
用户1392789

你有错误日志吗?

没有细节,我怀疑你的图像路径存在问题:"images/info.png"。在模拟器中,它们是不区分大小写的,但在设备上是区分大小写的。

我希望能帮到你。

2014-01-09 05:05:05