From 325b34a69148dab6dfbb10e6fd330f9f7f053204 Mon Sep 17 00:00:00 2001 From: chenxi Date: Thu, 20 Apr 2023 21:08:03 +0800 Subject: [PATCH] =?UTF-8?q?tips=E6=9C=80=E5=B0=8F=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/ui/tips/desc_tips.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/app/ui/tips/desc_tips.lua b/lua/app/ui/tips/desc_tips.lua index f0143d00..e78f4d48 100644 --- a/lua/app/ui/tips/desc_tips.lua +++ b/lua/app/ui/tips/desc_tips.lua @@ -36,7 +36,11 @@ function DescTips:onRefresh() -- 这里原来是用preferredHeight,但是在中英文混合的时候这个值可能不准,只有改用renderedHeight -- renderedHeight必须要先调用下ForceMeshUpdate强制刷新才有效 self.descTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO):ForceMeshUpdate() - self.bg:setSizeDeltaY(self.descTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).renderedHeight + 18) + local height = self.descTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).renderedHeight + 18 + if height < 130 then + height = 130 + end + self.bg:setSizeDeltaY(height) if self.tarCornerScreenPos then self:locate(self.location, self.originSizeDelta, self.bg, self.tarCornerScreenPos) end