刘海屏适配

This commit is contained in:
xiekaidong 2023-04-26 21:19:27 +08:00
parent 88e5f4b0df
commit cf3ee52e68

View File

@ -7,19 +7,17 @@ local DESIGN_HEIGHT = 1280
-- 获取刘海高度
function SafeAreaManager:getNotchScreenHeight()
-- local notchHeight = CS.BF.SafeAreaManager.GetNotchScreenHeight()
-- local width, height = GFunc.getScreenSize()
-- local sw = width / DESIGN_WIDTH -- 0.64
-- local sh = height / DESIGN_HEIGHT -- 0.52
-- local minScale = 1
-- if sw < sh then
-- minScale = sw
-- else
-- minScale = sh
-- end
-- return notchHeight / minScale
-- 此项目不用处理刘海屏适配
return 0
local notchHeight = CS.BF.SafeAreaManager.GetNotchScreenHeight()
local width, height = GFunc.getScreenSize()
local sw = width / DESIGN_WIDTH -- 0.64
local sh = height / DESIGN_HEIGHT -- 0.52
local minScale = 1
if sw < sh then
minScale = sw
else
minScale = sh
end
return notchHeight / minScale
end
return SafeAreaManager