코로나 SDK의 MapView에 대한 도움이 필요합니다. 배경으로지도를 넣고 싶지만 (이 경우 모든 기능 포함),이 경우 앞에있는 버튼을 누르십시오. 맵뷰 MapView는 기본 객체가 내가 어떤 그룹과 '지도보기 : toBack()'에 추가 할 수 없습니다 때문에MapView to background - 코로나 SDK
function scene:createScene(event)
local group = self.view
if (system.getInfo("environment") == "simulator") then
local simulatorMessage = "Maps not supported in Corona Simulator.\nYou must build for iOS or Android to test native.newMapView() support."
local label = display.newText(simulatorMessage, 36, 40, 270, 0, native.systemFont, 12)
label.anchorX = 0
label.anchorY = 0
end
myMap = native.newMapView(20, 20, display.contentWidth, display.contentHeight)
if (myMap) then
myMap.mapType = "normal"
myMap.x = display.contentCenterX
myMap.y = display.contentCenterY
myMap:setCenter(currentLatitude, currentLongitude)
myMap:addEventListener("mapLocation", mapLocationListener)
end
backBtn = widget.newButton
{
id="backButton",
label="Back",
fontSize="30",
labelColor={ default={1, 1, 1}, over={0, 0, 0, 0.5} },
defaultFile="images/button.png",
width = dispWidth * 0.25, height = dispHeight * 0.1,
onRelease = onBackBtnRelease
}
backBtn.anchorX = 0.5
backBtn.anchorY = 0.5
backBtn.x = display.contentWidth * 0.8
backBtn.y = dispHeight * 0.8
backBtn:toFront()
group:insert(backBtn)
group:toFront() --second try to put that button to front
end
: 여기 내 코드 '시도 인덱스 upvalue에'(잘 작동하지 않습니다에는 myMap '(nil 값)'). 코로나 SDK에서 버튼은 예상대로 맵없이 표시됩니다. 장치에서 나는 예상대로 내 버튼이없는지도를 얻습니다.
네이티브 개체를 뒤쪽에 배치하거나 무언가를 앞쪽으로 배치 할 수 있습니까?
디자인이 변경되었습니다. 코로나에는 결함이 있으며 단순한 앱/게임 이외의 다른 용도로 사용하지 않는 것이 좋습니다. – Arthur
@Arthur 동의합니다. 네이티브 개체에 더 많은 융통성이 필요합니다.지도 앱을 개발 중이며 정확한 이유 때문에 네이티브로 이동해야했습니다. 이 솔루션은 코로나 카드를 사용하여 코로나와 네이티브를 혼합 할 수 있지만 현재 베타 버전입니다. –