diff --git a/lua/app/common/safe_area_manager.lua b/lua/app/common/safe_area_manager.lua index f96eed4d..3ce433f6 100644 --- a/lua/app/common/safe_area_manager.lua +++ b/lua/app/common/safe_area_manager.lua @@ -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 \ No newline at end of file