获得软件导航按钮的高度?

时间:2014-07-09 16:51:41

标签: lua corona

我有一个Nexus 5,当display.contentHeight返回整个屏幕高度时,包括BackHomeOpen Apps条。如何从高处排除该栏?

1 个答案:

答案 0 :(得分:0)

Corona forums中找到,您可以尝试使用此代码来了解屏幕的高度:

local SCREEN_LEFT = Display.screenOriginX
local SCREEN_RIGHT = Display.contentWidth - Display.screenOriginX
local SCREEN_WIDTH = SCREEN_RIGHT - SCREEN_LEFT
local SCREEN_CENTER_X = SCREEN_WIDTH/2 + SCREEN_LEFT

local SCREEN_TOP = Display.topStatusBarContentHeight + Display.screenOriginY
local SCREEN_BOTTOM = Display.contentHeight - Display.screenOriginY
local SCREEN_HEIGHT = SCREEN_BOTTOM - SCREEN_TOP
local SCREEN_CENTER_Y = SCREEN_HEIGHT/2 + SCREEN_TOP